Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 382 Bytes

README.md

File metadata and controls

16 lines (11 loc) · 382 Bytes

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);