diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2020-03-13 19:29:32 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2020-03-17 11:15:17 -0700 |
commit | 5b3f27746529c746231d1d1ddef83b5c4e0b2160 (patch) | |
tree | 21447a63a48bb4269bb21145289bf9718328f524 /components/layout_2020 | |
parent | 9cb824e77ca1cea699358971f7568e869c1c4664 (diff) | |
download | servo-5b3f27746529c746231d1d1ddef83b5c4e0b2160.tar.gz servo-5b3f27746529c746231d1d1ddef83b5c4e0b2160.zip |
Implement `Default` for `ArcRefCell`
Diffstat (limited to 'components/layout_2020')
-rw-r--r-- | components/layout_2020/cell.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/components/layout_2020/cell.rs b/components/layout_2020/cell.rs index e12201e4b28..8aae377b24c 100644 --- a/components/layout_2020/cell.rs +++ b/components/layout_2020/cell.rs @@ -28,6 +28,17 @@ impl<T> Clone for ArcRefCell<T> { } } +impl<T> Default for ArcRefCell<T> +where + T: Default, +{ + fn default() -> Self { + Self { + value: Arc::new(AtomicRefCell::new(Default::default())), + } + } +} + impl<T> Deref for ArcRefCell<T> { type Target = AtomicRefCell<T>; |