Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement Default for ArcRefCell
  • Loading branch information
pcwalton committed Mar 17, 2020
1 parent 9cb824e commit 5b3f277
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/layout_2020/cell.rs
Expand Up @@ -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>;

Expand Down

0 comments on commit 5b3f277

Please sign in to comment.