From 2b5e18b78716eef1adabe61b888521bc34cd47a7 Mon Sep 17 00:00:00 2001 From: Preston Evans Date: Thu, 25 Apr 2024 09:01:28 -0500 Subject: [PATCH] Improve feature granularity in maybestd to fix warns --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3810495..fbca929 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,11 +18,15 @@ extern crate alloc; mod maybestd { #[cfg(not(feature = "std"))] - pub use alloc::{boxed, collections, format, string, vec}; + pub use alloc::{boxed, vec}; + #[cfg(all(not(feature = "std"), feature = "serde"))] + pub use alloc::{format, string}; #[cfg(not(feature = "std"))] pub use core::{cmp, fmt, hash, marker, mem, ops}; #[cfg(feature = "std")] pub use std::{boxed, cmp, fmt, hash, marker, mem, ops, vec}; + #[cfg(all(feature = "std", feature = "serde"))] + pub use std::{format, string}; pub mod hash_or_btree_map { #[cfg(not(feature = "std"))]