| Crates.io | collections_macros |
| lib.rs | collections_macros |
| version | 1.0.1 |
| created_at | 2022-02-17 05:19:35.356011+00 |
| updated_at | 2022-02-17 05:25:21.402988+00 |
| description | a collection of macros to make making collections easier |
| homepage | https://github.com/lizelive/collections_macros |
| repository | https://github.com/lizelive/collections_macros |
| max_upload_size | |
| id | 533880 |
| size | 6,105 |
some macros for dicts
creates hashmap, hashset, btreeset, btreemap
map has two sytaxts
let a = 1;
let b = 2;
hashmap![
a: a+b,
b: b
],
is equal to
std::collections::HashMap::from([(a, a), (b, a + b)])
but if you dont include commas it acts like yml and gets names from ident
hashmap![
a: a+b
b: b
],
is equal to
std::collections::HashMap::from([("a", a + b), ("b", b)])