aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_arena/src/map.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_arena/src/map.rs')
-rw-r--r--crates/ra_arena/src/map.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_arena/src/map.rs b/crates/ra_arena/src/map.rs
index be80edaf3..b73d4e365 100644
--- a/crates/ra_arena/src/map.rs
+++ b/crates/ra_arena/src/map.rs
@@ -42,10 +42,7 @@ impl<ID: ArenaId, T> ArenaMap<ID, T> {
42 } 42 }
43 43
44 pub fn iter(&self) -> impl Iterator<Item = (ID, &T)> { 44 pub fn iter(&self) -> impl Iterator<Item = (ID, &T)> {
45 self.v 45 self.v.iter().enumerate().filter_map(|(idx, o)| Some((Self::from_idx(idx), o.as_ref()?)))
46 .iter()
47 .enumerate()
48 .filter_map(|(idx, o)| Some((Self::from_idx(idx), o.as_ref()?)))
49 } 46 }
50 47
51 fn to_idx(id: ID) -> usize { 48 fn to_idx(id: ID) -> usize {
@@ -66,9 +63,6 @@ impl<ID: ArenaId, T> std::ops::Index<ID> for ArenaMap<ID, T> {
66 63
67impl<ID, T> Default for ArenaMap<ID, T> { 64impl<ID, T> Default for ArenaMap<ID, T> {
68 fn default() -> Self { 65 fn default() -> Self {
69 ArenaMap { 66 ArenaMap { v: Vec::new(), _ty: PhantomData }
70 v: Vec::new(),
71 _ty: PhantomData,
72 }
73 } 67 }
74} 68}