mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Derive the Default trait for dictionaries containing GC values.
This commit is contained in:
parent
b169689f32
commit
16166d6673
6 changed files with 49 additions and 7 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue