1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Compact, inline-optimized hash set.
//!
//! [`SmallSet`] stores up to `N` values inline (on the stack) and spills to a
//! heap-allocated [`hashbrown::HashSet`](hashbrown) when the inline capacity
//! is exceeded. It is a thin newtype over [`SmallMap<T, (), N, S>`](crate::SmallMap).
pub use ;
use crateSmallMap;
/// A compact hash set that stores up to `N` values inline and spills to the
/// heap when the inline capacity is exceeded.
///
/// This is a newtype over [`SmallMap<T, (), N, S>`](crate::SmallMap). For small
/// sets (≤ `N` entries), all data lives on the stack. When the set grows
/// beyond `N`, it transparently spills to a heap-allocated hash set.
///
/// The default inline capacity is 8 entries.
///
/// # Examples
/// ```
/// use turbocow::SmallSet;
///
/// let mut set = SmallSet::<&str>::new();
/// set.insert("hello");
/// set.insert("world");
/// assert!(set.contains("hello"));
/// assert_eq!(set.len(), 2);
/// ```
,
);