Skip to content

Commit d74b294

Browse files
authored
Merge pull request rust-lang#40 from garro95/master
Added index() method for OccupiedEntry
2 parents 9dce2c3 + 26537e7 commit d74b294

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,10 @@ impl<'a, K, V, S> OccupiedEntry<'a, K, V, S> {
501501
pub fn get_mut(&mut self) -> &mut V {
502502
&mut self.map.entries[self.index].value
503503
}
504+
505+
pub fn index(&self) -> usize {
506+
self.index
507+
}
504508
pub fn into_mut(self) -> &'a mut V {
505509
&mut self.map.entries[self.index].value
506510
}

0 commit comments

Comments
 (0)