Begin with the brush data structure

This patch also adds `extend` to `SharedVector`, for convenience.
This commit is contained in:
Simon Hausmann 2021-02-01 14:26:27 +01:00
parent 2d12e118ac
commit b90eb04088
4 changed files with 94 additions and 0 deletions

View file

@ -314,6 +314,14 @@ impl<T> FromIterator<T> for SharedVector<T> {
}
}
impl<T: Clone> Extend<T> for SharedVector<T> {
fn extend<X: IntoIterator<Item = T>>(&mut self, iter: X) {
for item in iter {
self.push(item);
}
}
}
static SHARED_NULL: SharedVectorHeader =
SharedVectorHeader { refcount: std::sync::atomic::AtomicIsize::new(-1), size: 0, capacity: 0 };