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

@ -9,6 +9,7 @@ use html5ever::{LocalName, Namespace};
use servo_atoms::Atom;
use std::ascii::AsciiExt;
use std::borrow::{Borrow, Cow, ToOwned};
use std::default::Default;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
@ -18,7 +19,7 @@ use std::str;
use std::str::{Bytes, FromStr};
/// Encapsulates the IDL `ByteString` type.
#[derive(Clone, Debug, Eq, HeapSizeOf, JSTraceable, PartialEq)]
#[derive(Clone, Debug, Default, Eq, HeapSizeOf, JSTraceable, PartialEq)]
pub struct ByteString(Vec<u8>);
impl ByteString {
@ -77,7 +78,7 @@ impl ops::Deref for ByteString {
/// A string that is constructed from a UCS-2 buffer by replacing invalid code
/// points with the replacement character.
#[derive(Clone, HeapSizeOf)]
#[derive(Clone, Default, HeapSizeOf)]
pub struct USVString(pub String);