3 releases

0.1.3 Apr 18, 2020
0.1.2 Apr 18, 2020
0.1.1 Apr 15, 2020
0.1.0 Apr 14, 2020

#1434 in Data structures

Download history 4268/week @ 2023-12-09 2757/week @ 2023-12-16 786/week @ 2023-12-23 1991/week @ 2023-12-30 1579/week @ 2024-01-06 2073/week @ 2024-01-13 3219/week @ 2024-01-20 4299/week @ 2024-01-27 5256/week @ 2024-02-03 6577/week @ 2024-02-10 5209/week @ 2024-02-17 6455/week @ 2024-02-24 7844/week @ 2024-03-02 8947/week @ 2024-03-09 10057/week @ 2024-03-16 2350/week @ 2024-03-23

30,005 downloads per month
Used in 14 crates (8 directly)

MIT/Apache

8KB
87 lines

Literally

docs crates.io License: MIT OR Apache-2.0 CI Minimum rustc version

I found the methods and ergonomics of maplit aggravating so I made this. It's basically the same code except that the names are different and the values are .into()'d.

Enjoy.

Example

use std::collections::{HashMap, HashSet};
use literally::{hmap, hset};
let m: HashMap<String, HashSet<String>> = hmap!{ 
    "key" => hset!{
        "value"
    }
};
assert_eq!(m.get("key").unwrap().get("value"), Some(&"value".to_string()))

Rust Version Requirements

1.38+

License

Licensed under either of the following at your option.

Credit

Like I said, this is maplit but with ergonomics changes. All credit should be directed there. Again, I literally copied and pasted the code from maplit and changed the ergonomics slightly.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

No runtime deps