ringmap

Macro ringmap 

Source
macro_rules! ringmap {
    ($($key:expr => $value:expr,)+) => { ... };
    ($($key:expr => $value:expr),*) => { ... };
}
Available on crate feature std only.
Expand description

Create a RingMap from a list of key-value pairs

ยงExample

use ringmap::ringmap;

let map = ringmap!{
    "a" => 1,
    "b" => 2,
};
assert_eq!(map["a"], 1);
assert_eq!(map["b"], 2);
assert_eq!(map.get("c"), None);

// "a" is the first key
assert_eq!(map.keys().next(), Some(&"a"));