mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue