Implement Default for ArcRefCell

This commit is contained in:
Patrick Walton 2020-03-13 19:29:32 -07:00
parent 9cb824e77c
commit 5b3f277465

View file

@ -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>;