case_insensitive_hashmap 0.9.1

A HashMap that uses case-insensitive strings as keys.
Documentation

CaseInsensitiveHashMap

A hashmap for Rust that uses case-insensitive strings as keys.

let mut map = CaseInsensitiveHashMap::<u8>::new();
map.insert("A", 1);
assert!(map.contains_key("A"));
assert!(map.contains_key("a"));
assert!(!map.contains_key("B"));
assert!(!map.contains_key("Å"));

The API is identical to the HashMap in std.

Implementation

This use the UniCase crate to handle the case-insensitivity. Strings that are used as keys are wrapped in UniCase objects so that they hash and compare for equality in a case-insensitive manner.