diff --git a/src/display.rs b/src/display.rs index 163bbfd..854156f 100644 --- a/src/display.rs +++ b/src/display.rs @@ -1,7 +1,7 @@ #[cfg(not(feature = "std"))] -use core::fmt::{Display, Formatter}; +use core::fmt::{self, Display, Formatter}; #[cfg(feature = "std")] -use std::fmt::{Display, Formatter}; +use std::fmt::{self, Display, Formatter}; use typenum::Integer; @@ -172,7 +172,7 @@ where Candela: Integer, T: Display + 'static, { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { write!(f, "{}", self.value)?; // derived units with special symbols display_special_unit!(f, Self, diff --git a/src/lib.rs b/src/lib.rs index f0437c5..a2e6313 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![cfg_attr(not(feature = "std"), no_std)] mod display; pub mod types;