Skip to content

Commit 29d6fcc

Browse files
fitzgenTrevor Elliott
andauthored
cranelift-entity: Implement Extend for EntitySet (bytecodealliance#9068)
Co-authored-by: Trevor Elliott <[email protected]>
1 parent f763f0e commit 29d6fcc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cranelift/entity/src/set.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ impl<K: EntityRef> Default for EntitySet<K> {
2727
}
2828
}
2929

30+
impl<K: EntityRef> Extend<K> for EntitySet<K> {
31+
fn extend<T: IntoIterator<Item = K>>(&mut self, iter: T) {
32+
for k in iter {
33+
self.insert(k);
34+
}
35+
}
36+
}
37+
3038
/// Shared `EntitySet` implementation for all value types.
3139
impl<K> EntitySet<K>
3240
where

0 commit comments

Comments
 (0)