Skip to content

Commit d7eae73

Browse files
committed
Fix crate collections for no-std
Add missing type alias for `HashSet`, and better separation of cfg feature attributes.
1 parent ea61aff commit d7eae73

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,17 @@ pub use selection::*;
3535
pub use selector::*;
3636
pub use signer::*;
3737

38+
#[cfg(feature = "std")]
3839
pub(crate) mod collections {
3940
#![allow(unused)]
40-
41-
#[cfg(feature = "std")]
4241
pub use std::collections::*;
42+
}
4343

44-
#[cfg(not(feature = "std"))]
44+
#[cfg(not(feature = "std"))]
45+
pub(crate) mod collections {
46+
#![allow(unused)]
4547
pub type HashMap<K, V> = alloc::collections::BTreeMap<K, V>;
48+
pub type HashSet<T> = alloc::collections::BTreeSet<T>;
4649
pub use alloc::collections::*;
4750
}
4851

0 commit comments

Comments
 (0)