We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d3eb7cd commit 008828fCopy full SHA for 008828f
src/map.rs
@@ -1031,6 +1031,19 @@ where
1031
}
1032
1033
1034
+ /// Return item index
1035
+ pub fn get_index<Q: ?Sized>(&self, key: &Q) -> Option<usize>
1036
+ where
1037
+ Q: Hash + Equivalent<K>,
1038
+ {
1039
+ if let Some((_, found)) = self.find(key) {
1040
+ let entry = &self.core.entries[found];
1041
+ Some(found)
1042
+ } else {
1043
+ None
1044
+ }
1045
1046
+
1047
pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V>
1048
where
1049
Q: Hash + Equivalent<K>,
0 commit comments