diff options
author | Joey Sacchini <joey@sacchini.net> | 2020-10-19 12:22:05 -0400 |
---|---|---|
committer | Joey Sacchini <joey@sacchini.net> | 2020-10-19 12:22:05 -0400 |
commit | 4deb1954d5f565feb7dbbc007124455da085cf7f (patch) | |
tree | 90742d4493db8a8c15f8fd4cf8ef313cb2ec92ac /src/types.rs | |
parent | 239a60fddab2694836f3117de429b9bf40256766 (diff) | |
download | mcproto-rs-4deb1954d5f565feb7dbbc007124455da085cf7f.tar.gz mcproto-rs-4deb1954d5f565feb7dbbc007124455da085cf7f.tar.bz2 mcproto-rs-4deb1954d5f565feb7dbbc007124455da085cf7f.zip |
fix mistakes when implementing no_std
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/types.rs b/src/types.rs index 47df47b..f22b280 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,6 +1,6 @@ // ... PRIMITIVE TYPES ... -use alloc::{string::String, vec::Vec}; +use alloc::{string::String, vec::Vec, fmt}; use crate::utils::*; use crate::uuid::UUID4; use crate::*; @@ -251,8 +251,8 @@ impl From<usize> for VarInt { } } -impl std::fmt::Display for VarInt { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl fmt::Display for VarInt { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "VarInt({})", self.0) } } @@ -739,7 +739,7 @@ impl TestRandom for Slot { } } -#[cfg(all(test, feature = "std"))] +#[cfg(test)] mod tests { use super::*; use alloc::fmt::Debug; @@ -905,6 +905,7 @@ mod tests { }); } + #[cfg(feature = "std")] #[test] fn test_uuid() { for _ in 0..5 { |