-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Hi, can we have an API similar to HashMap::retain:
pub fn retain<F>(&mut self, f: F)
where
F: FnMut(&K, &mut V) -> boolIt only retains all the elements that satisfies the f predicate, and removes all other elements?
Actually I don't mind to use the drain API to archive the same result, I think I could first use drain to empty the cache, and iterate all the elements and insert back those satisfy the f predicate.
Do they have the same performance?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers