From 26537e7ba15219b898b73091d114ed5fbc857cef Mon Sep 17 00:00:00 2001 From: Gianmarco Garrisi Date: Tue, 26 Sep 2017 12:18:05 +0200 Subject: [PATCH] Added index() method for OccupiedEntry --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 5a94c027b8..ab688829cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 }