Skip to main content

insert_within_limit

Function insert_within_limit 

Source
fn insert_within_limit<K: Ord, V>(
    map: &mut BTreeMap<K, V>,
    key: K,
    value: V,
    limit: Option<usize>,
)
Expand description

Inserts key and value into map, then removes its last entry if it has more than limit entries.