diff --git a/Cargo.toml b/Cargo.toml index 5443bf5..7f54015 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "hex_fmt" description = "Formatting and shortening byte slices as hexadecimal strings" -version = "0.2.0" +version = "0.3.0" license = "MIT/Apache-2.0" authors = ["Andreas Fackler "] repository = "https://github.com/poanetwork/hex_fmt" readme = "README.md" keywords = ["format", "hex", "display", "debug"] -categories = ["value-formatting", "development-tools::debugging"] +categories = ["value-formatting", "development-tools::debugging", "no-std"] edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index 75aebff..93d358f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,7 +37,9 @@ //! assert_eq!("[0A.., 1B.., 2C..]", &format!("{:<4X}", HexList(list))); //! ``` -use std::fmt::{Alignment, Debug, Display, Formatter, LowerHex, Result, UpperHex, Write}; +#![cfg_attr(not(test), no_std)] + +use core::fmt::{Alignment, Debug, Display, Formatter, LowerHex, Result, UpperHex, Write}; const ELLIPSIS: &str = "..";