We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HashMap has this method:
HashMap
pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V> where K: Borrow<Q>, Q: Hash + Eq { self.search(k).map(|bucket| bucket.into_refs().1) }
I’d like to add this one, where the only difference is removing .1:
.1
pub fn get_pair<Q: ?Sized>(&self, k: &Q) -> Option<(&K, &V)> where K: Borrow<Q>, Q: Hash + Eq { self.search(k).map(|bucket| bucket.into_refs()) }
This can be useful when K is &'a T where 'a is a longer lifetime than in Q.
K
&'a T
'a
Q
Is this too obscure to pull its weight in std?
std
CC @gankro
The text was updated successfully, but these errors were encountered:
This is rust-lang/rfcs#1194.
Sorry, something went wrong.
Indeed, thanks!
No branches or pull requests
HashMap
has this method:I’d like to add this one, where the only difference is removing
.1
:This can be useful when
K
is&'a T
where'a
is a longer lifetime than inQ
.Is this too obscure to pull its weight in
std
?CC @gankro
The text was updated successfully, but these errors were encountered: