aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_arena
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-25 07:29:00 +0000
committerAleksey Kladov <[email protected]>2019-01-25 07:29:00 +0000
commit74beb5bfcbc33d6232a9b08b4df4bcfd781790e9 (patch)
treece68818c693d878128f5c3d7116c9c695ac269b2 /crates/ra_arena
parented27bd8d776e7efd4394d6cdda02aa7f93c48273 (diff)
simplify
Diffstat (limited to 'crates/ra_arena')
-rw-r--r--crates/ra_arena/src/map.rs4
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 }