Skip to content

Commit 37582b2

Browse files
authored
chore: shorten map type alias names (#824)
1 parent 0fdb0b5 commit 37582b2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

crates/primitives/src/map/fixed.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ use core::{
77
};
88

99
/// [`HashMap`] optimized for hashing [fixed-size byte arrays](FixedBytes).
10-
pub type FbHashMap<const N: usize, V> = HashMap<FixedBytes<N>, V, FbBuildHasher<N>>;
10+
pub type FbMap<const N: usize, V> = HashMap<FixedBytes<N>, V, FbBuildHasher<N>>;
11+
#[doc(hidden)]
12+
pub type FbHashMap<const N: usize, V> = FbMap<N, V>;
1113
/// [`HashSet`] optimized for hashing [fixed-size byte arrays](FixedBytes).
12-
pub type FbHashSet<const N: usize> = HashSet<FixedBytes<N>, FbBuildHasher<N>>;
14+
pub type FbSet<const N: usize> = HashSet<FixedBytes<N>, FbBuildHasher<N>>;
15+
#[doc(hidden)]
16+
pub type FbHashSet<const N: usize> = FbSet<N>;
1317

1418
cfg_if! {
1519
if #[cfg(feature = "map-indexmap")] {
@@ -26,9 +30,13 @@ macro_rules! fb_alias_maps {
2630
($($ty:ident < $n:literal >),* $(,)?) => { paste::paste! {
2731
$(
2832
#[doc = concat!("[`HashMap`] optimized for hashing [`", stringify!($ty), "`].")]
29-
pub type [<$ty HashMap>]<V> = HashMap<$ty, V, FbBuildHasher<$n>>;
33+
pub type [<$ty Map>]<V> = HashMap<$ty, V, FbBuildHasher<$n>>;
34+
#[doc(hidden)]
35+
pub type [<$ty HashMap>]<V> = [<$ty Map>]<V>;
3036
#[doc = concat!("[`HashSet`] optimized for hashing [`", stringify!($ty), "`].")]
31-
pub type [<$ty HashSet>] = HashSet<$ty, FbBuildHasher<$n>>;
37+
pub type [<$ty Set>] = HashSet<$ty, FbBuildHasher<$n>>;
38+
#[doc(hidden)]
39+
pub type [<$ty HashSet>] = [<$ty Set>];
3240

3341
cfg_if! {
3442
if #[cfg(feature = "map-indexmap")] {

0 commit comments

Comments
 (0)