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

@ -6,6 +6,7 @@
use heapsize::HeapSizeOf;
use num_traits::Float;
use std::default::Default;
use std::ops::Deref;
/// Encapsulates the IDL restricted float type.
@ -45,3 +46,9 @@ impl<T: Float + HeapSizeOf> HeapSizeOf for Finite<T> {
(**self).heap_size_of_children()
}
}
impl<T: Float + Default> Default for Finite<T> {
fn default() -> Finite<T> {
Finite::wrap(T::default())
}
}