[][src]Macro col_macros::hash_set

macro_rules! hash_set {
    (for $map:expr, ins $( $k:expr ),*) => { ... };
    (for $map:tt, ins $( $k:tt ,)*) => { ... };
    ( $( $k:expr ),*) => { ... };
    ( $( $k:tt ,)*) => { ... };
}

Construct or update a set of type Set<K> which can be and is an alias to HashSet in the types module.

Collections with a capacity and the insert method are accepted,BTreeSet not.

Examples

#![feature(proc_macro_hygiene)]
use col_macros::hash_set;
use col_macros::types::Set;

let mut hash = hash_set!["key1", "key2"];

assert!(hash.contains("key1"));
assert!(hash.contains("key2"));

hash = hash_set![for hash, ins "key3", "key4"];

assert!(hash.contains("key3"));
assert!(hash.contains("key4"));