Skip to main content

proof_of_sql/base/
map.rs

1/// Alias for the `IndexMap` with a hash builder of type `BuildHasherDefault<AHasher>`
2pub type IndexMap<K, V> = indexmap::IndexMap<K, V, core::hash::BuildHasherDefault<ahash::AHasher>>;
3pub(crate) type IndexSet<T> = indexmap::IndexSet<T, core::hash::BuildHasherDefault<ahash::AHasher>>;
4
5/// Create an [`IndexMap`][self::IndexMap] from a list of key-value pairs
6#[cfg(test)]
7macro_rules! indexmap {
8    ($($key:expr => $value:expr,)+) => { indexmap::indexmap_with_default!{ahash::AHasher; $($key => $value),+} };
9    ($($key:expr => $value:expr),*) => { indexmap::indexmap_with_default!{ahash::AHasher; $($key => $value),*} };
10}
11
12/// Create an [`IndexSet`][self::IndexSet] from a list of values
13macro_rules! indexset {
14    ($($value:expr,)+) => { indexmap::indexset_with_default!{ahash::AHasher; $($value),+} };
15    ($($value:expr),*) => { indexmap::indexset_with_default!{ahash::AHasher; $($value),*} };
16}
17
18#[cfg(test)]
19pub(crate) use indexmap;
20pub(crate) use indexset;