Method in collections::tree · TreeMap coil-stdlib

TreeMap::min_key

pub fn min_key(K fallback) -> K
Import
use collections::tree::{TreeMap};
Source: src/collections/tree.hy

Returns the smallest key, or fallback when the map is empty.

Called on a TreeMap value as value.min_key(…).

Parameters#

NameType
fallbackK

Returns#

K

Examples#

use collections::tree::{TreeMap};
use tests::assert;
let m: TreeMap<int, bool> = TreeMap::new();
assert!(m.min_key(-1) == -1);
m.insert(4, true);
m.insert(2, true);
assert!(m.min_key(-1) == 2);

See also#

↑ ↓ navigate ↵ open