idmap 0.3.9

Efficient maps of integer id keys to values, backed by an underlying `Vec`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Test [`IdMap`] with various impls.

use primint::num::NonMax;

#[test]
fn nonmax() {
    fn new(x: u32) -> NonMax<u32> {
        NonMax::<u32>::new(x).unwrap()
    }
    let map = idmap::direct_idmap! {
        new(0) => "foo",
        new(1) => "bar",
        new(2) => "baz",
    };
    assert_eq!(map.get(new(0)).copied(), Some("foo"));
    assert_eq!(map.get(new(20)), None);
}