std_macro_extensions/hash_set/macro.rs
1/// Creates a new `HashSet` instance.
2///
3/// This macro can be used in two forms:
4/// - Without arguments, it creates an empty `HashSet`.
5/// - With elements, it creates a `HashSet` and inserts the provided elements into it.
6#[macro_export]
7macro_rules! hash_set {
8 () => {
9 std::collections::HashSet::new()
10 };
11 ($($elem:expr),*) => {{
12 std::collections::HashSet::from([$($elem),*])
13 }};
14}