diff options
author | Joey Sacchini <joey@sacchini.net> | 2020-10-19 11:55:37 -0400 |
---|---|---|
committer | Joey Sacchini <joey@sacchini.net> | 2020-10-19 11:55:37 -0400 |
commit | 239a60fddab2694836f3117de429b9bf40256766 (patch) | |
tree | 007b927a3f3864639321cc988b0b0ad68f2c8662 /src/nbt.rs | |
parent | a2c1bcbf82a3ed7d76d464abab708f5472cfaa3f (diff) | |
download | mcproto-rs-239a60fddab2694836f3117de429b9bf40256766.tar.gz mcproto-rs-239a60fddab2694836f3117de429b9bf40256766.tar.bz2 mcproto-rs-239a60fddab2694836f3117de429b9bf40256766.zip |
allow no_std with alloc
Diffstat (limited to 'src/nbt.rs')
-rw-r--r-- | src/nbt.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -2,9 +2,9 @@ use crate::utils::{ read_int, read_long, read_one_byte, read_short, take, write_int, write_long, write_short, }; use crate::{DeserializeErr, DeserializeResult, Deserialized}; -use std::fmt; +use alloc::{string::{String, ToString}, borrow::ToOwned, fmt, vec::Vec}; -#[cfg(test)] +#[cfg(all(test, feature = "std"))] use crate::protocol::TestRandom; #[derive(Clone, Debug, PartialEq)] @@ -26,7 +26,7 @@ impl NamedTag { } } -#[cfg(test)] +#[cfg(all(test, feature = "std"))] impl TestRandom for NamedTag { fn test_gen_random() -> Self { Self { @@ -125,7 +125,7 @@ impl Tag { } } -#[cfg(test)] +#[cfg(all(test, feature = "std"))] impl TestRandom for Tag { fn test_gen_random() -> Self { let random_idx = rand::random::<usize>() % 8; @@ -518,7 +518,7 @@ impl Tag { } // test -#[cfg(test)] +#[cfg(all(test, feature = "std"))] mod tests { use super::*; use flate2::read::GzDecoder; |