diff --git a/src/lib.rs b/src/lib.rs index 9924f47..4aa107b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,7 @@ //! //! ### When not to use //! Generally don't use this if your key would have a lot of collisions being represents in 8 bits, otherwise it might be a faster alternative to hash-based maps. You should check yourself before sticking with this crate instead of `std`'s vectorised map implementations. -#![cfg_attr(not(test), no_std)] +#![cfg_attr(any(not(test), not(feature = "std")), no_std)] #![cfg_attr(nightly, feature(test))] #![cfg_attr(nightly, feature(drain_filter))] #![cfg_attr(nightly, feature(never_type))] diff --git a/src/page_impls.rs b/src/page_impls.rs index 6ac4b0a..99a7753 100644 --- a/src/page_impls.rs +++ b/src/page_impls.rs @@ -49,7 +49,7 @@ impl hash::Hash for Page { #[cfg(feature="serde")] const _: () = { use serde::*; - use std::marker::PhantomData; + use core::marker::PhantomData; impl serde::Serialize for Page where K:Serialize, V: Serialize @@ -93,7 +93,7 @@ const _: () = { Ok(Page(elems)) } else { use serde::de::Error; - Err(A::Error::custom(format!("Expected {} elemts, got {}", MAX, i))) + Err(A::Error::custom(alloc::format!("Expected {} elemts, got {}", MAX, i))) } } }