diff options
Diffstat (limited to 'components/devtools_traits/lib.rs')
-rw-r--r-- | components/devtools_traits/lib.rs | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/components/devtools_traits/lib.rs b/components/devtools_traits/lib.rs index 44a55001a0e..f084d70d638 100644 --- a/components/devtools_traits/lib.rs +++ b/components/devtools_traits/lib.rs @@ -21,7 +21,6 @@ extern crate heapsize; extern crate hyper; extern crate ipc_channel; extern crate msg; -extern crate rustc_serialize; extern crate serde; extern crate time; extern crate url; @@ -32,7 +31,6 @@ use hyper::http::RawStatus; use hyper::method::Method; use ipc_channel::ipc::IpcSender; use msg::constellation_msg::PipelineId; -use rustc_serialize::{Decodable, Decoder}; use std::net::TcpStream; use time::Duration; use time::Tm; @@ -218,26 +216,12 @@ pub enum DevtoolScriptControlMsg { RequestAnimationFrame(PipelineId, String), } -#[derive(RustcEncodable, Deserialize, Serialize)] +#[derive(Deserialize, Serialize)] pub struct Modification { pub attributeName: String, pub newValue: Option<String>, } -impl Decodable for Modification { - fn decode<D: Decoder>(d: &mut D) -> Result<Modification, D::Error> { - d.read_struct("Modification", 2, |d| - Ok(Modification { - attributeName: try!(d.read_struct_field("attributeName", 0, Decodable::decode)), - newValue: match d.read_struct_field("newValue", 1, Decodable::decode) { - Ok(opt) => opt, - Err(_) => None - } - }) - ) - } -} - #[derive(Clone, Deserialize, Serialize)] pub enum LogLevel { Log, @@ -264,9 +248,10 @@ bitflags! { } } -#[derive(RustcEncodable, Deserialize, Serialize)] +#[derive(Deserialize, Serialize)] pub struct PageError { - pub _type: String, + #[serde(rename = "type")] + pub type_: String, pub errorMessage: String, pub sourceName: String, pub lineText: String, @@ -281,9 +266,10 @@ pub struct PageError { pub private: bool, } -#[derive(RustcEncodable, Deserialize, Serialize)] +#[derive(Deserialize, Serialize)] pub struct ConsoleAPI { - pub _type: String, + #[serde(rename = "type")] + pub type_: String, pub level: String, pub filename: String, pub lineNumber: u32, |