forked from hyperledger-archives/ursa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatastructures.rs
47 lines (44 loc) · 929 Bytes
/
datastructures.rs
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
39
40
41
42
43
44
45
46
47
macro_rules! hashset {
( $( $x:expr ),* ) => {
{
let mut set = ::std::collections::HashSet::new();
$(
set.insert($x);
)*
set
}
}
}
macro_rules! hashmap {
($( $key: expr => $val: expr ),*) => {
{
let mut map = ::std::collections::HashMap::new();
$(
map.insert($key, $val);
)*
map
}
}
}
macro_rules! btreeset {
( $( $x:expr ),* ) => {
{
let mut set = ::std::collections::BTreeSet::new();
$(
set.insert($x);
)*
set
}
}
}
macro_rules! btreemap {
($( $key: expr => $val: expr ),*) => {
{
let mut map = ::std::collections::BTreeMap::new();
$(
map.insert($key, $val);
)*
map
}
}
}