mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Begin with the brush data structure
This patch also adds `extend` to `SharedVector`, for convenience.
This commit is contained in:
parent
2d12e118ac
commit
b90eb04088
4 changed files with 94 additions and 0 deletions
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue