ACP: std::collections::{hash_map, btree_map}::Entry::{is_vacant, is_occupied}
#357
Labels
std::collections::{hash_map, btree_map}::Entry::{is_vacant, is_occupied}
#357
Proposal
Problem statement
Checking whether a map
Entry
is vacant or occupied isn't maximally idiomatic.Motivating examples or use cases
Ran into this today:
Solution sketch
Alternatives
matches!(entry, Entry::Vacant(_))
works but isn't as idiomatic and requires importingEntry
. This functionality is too small to belong in a crate.Links and related work
I looked at a few other map crates, and didn't find similar API's. Not sure why. Maybe they're mirroring
std
.What happens now?
This issue contains an API change proposal (or ACP) and is part of the libs-api team feature lifecycle. Once this issue is filed, the libs-api team will review open proposals as capability becomes available. Current response times do not have a clear estimate, but may be up to several months.
Possible responses
The libs team may respond in various different ways. First, the team will consider the problem (this doesn't require any concrete solution or alternatives to have been proposed):
Second, if there's a concrete solution:
The text was updated successfully, but these errors were encountered: