fn insert_within_limit<K: Ord, V>( map: &mut BTreeMap<K, V>, key: K, value: V, limit: Option<usize>, )
Inserts key and value into map, then removes its last entry if it has more than limit entries.
key
value
map
limit