diff options
Diffstat (limited to 'crates/ra_arena/src')
-rw-r--r-- | crates/ra_arena/src/map.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_arena/src/map.rs b/crates/ra_arena/src/map.rs index 2f09d677f..be80edaf3 100644 --- a/crates/ra_arena/src/map.rs +++ b/crates/ra_arena/src/map.rs | |||
@@ -29,6 +29,10 @@ impl<ID: ArenaId, T> ArenaMap<ID, T> { | |||
29 | self.v.get(Self::to_idx(id)).and_then(|it| it.as_ref()) | 29 | self.v.get(Self::to_idx(id)).and_then(|it| it.as_ref()) |
30 | } | 30 | } |
31 | 31 | ||
32 | pub fn get_mut(&mut self, id: ID) -> Option<&mut T> { | ||
33 | self.v.get_mut(Self::to_idx(id)).and_then(|it| it.as_mut()) | ||
34 | } | ||
35 | |||
32 | pub fn values(&self) -> impl Iterator<Item = &T> { | 36 | pub fn values(&self) -> impl Iterator<Item = &T> { |
33 | self.v.iter().filter_map(|o| o.as_ref()) | 37 | self.v.iter().filter_map(|o| o.as_ref()) |
34 | } | 38 | } |