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

#933 in Data structures

Download history 975/week @ 2024-06-19 1330/week @ 2024-06-26 1617/week @ 2024-07-03 1306/week @ 2024-07-10 1863/week @ 2024-07-17 1081/week @ 2024-07-24 1030/week @ 2024-07-31 1500/week @ 2024-08-07 2135/week @ 2024-08-14 1343/week @ 2024-08-21 3207/week @ 2024-08-28 2308/week @ 2024-09-04 866/week @ 2024-09-11 667/week @ 2024-09-18 773/week @ 2024-09-25 1254/week @ 2024-10-02

3,928 downloads per month
Used in 13 crates (7 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