Derive the Default trait for dictionaries containing GC values.

This commit is contained in:
Josh Matthews 2017-05-26 13:46:13 -04:00
parent b169689f32
commit 16166d6673
6 changed files with 49 additions and 7 deletions

View file

@ -769,6 +769,12 @@ impl<T: JSTraceable + 'static> RootedTraceableBox<T> {
}
}
impl<T: JSTraceable + Default> Default for RootedTraceableBox<T> {
fn default() -> RootedTraceableBox<T> {
RootedTraceableBox::new(T::default())
}
}
impl<T: JSTraceable> Deref for RootedTraceableBox<T> {
type Target = T;
fn deref(&self) -> &T {