fix no_std

This commit is contained in:
Max 2023-02-22 14:35:05 +01:00
parent c12219dd5a
commit 44ff54160c
2 changed files with 4 additions and 3 deletions

View File

@ -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,

View File

@ -1,3 +1,4 @@
#![cfg_attr(not(feature = "std"), no_std)]
mod display;
pub mod types;