Skip to content

Commit

Permalink
Merge pull request rust-lang#40 from garro95/master
Browse files Browse the repository at this point in the history
Added index() method for OccupiedEntry
  • Loading branch information
bluss authored Sep 26, 2017
2 parents 9dce2c3 + 26537e7 commit d74b294
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,10 @@ impl<'a, K, V, S> OccupiedEntry<'a, K, V, S> {
pub fn get_mut(&mut self) -> &mut V {
&mut self.map.entries[self.index].value
}

pub fn index(&self) -> usize {
self.index
}
pub fn into_mut(self) -> &'a mut V {
&mut self.map.entries[self.index].value
}
Expand Down

0 comments on commit d74b294

Please sign in to comment.