assoc

Crates.ioassoc
lib.rsassoc
version0.1.3
sourcesrc
created_at2021-02-28 22:35:00.254933
updated_at2023-01-31 03:14:54.740611
descriptionTreat vectors like associative arrays
homepagehttps://github.com/mingyli/assoc
repositoryhttps://github.com/mingyli/assoc
max_upload_size
id362020
size26,838
ming li (mingyli)

documentation

https://docs.rs/assoc

README

assoc

docs.rs

Treat vectors like associative arrays.

Examples

use assoc::AssocExt;

let mut map = vec![("a", 1), ("b", 2)];
map.entry("c").or_insert(3);
assert_eq!(map.get(&"c"), Some(&3));
assert_eq!(map.entry("c").or_insert(4), &3);
Commit count: 16

cargo fmt