mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use rustc-serialize rather than the built-in deprecated serialize.
This commit is contained in:
parent
4ab928728e
commit
aaed4a54c7
30 changed files with 54 additions and 33 deletions
|
@ -17,4 +17,5 @@ path = "../msg"
|
|||
path = "../util"
|
||||
|
||||
[dependencies]
|
||||
time = "*"
|
||||
time = "*"
|
||||
rustc-serialize = "0.2"
|
||||
|
|
|
@ -10,7 +10,7 @@ use std::cell::{Cell, RefCell};
|
|||
use std::old_io::TcpStream;
|
||||
use std::mem::{replace, transmute};
|
||||
use std::raw::TraitObject;
|
||||
use serialize::json;
|
||||
use rustc_serialize::json;
|
||||
|
||||
/// A common trait for all devtools actors that encompasses an immutable name
|
||||
/// and the ability to process messages that are directed to particular actors.
|
||||
|
|
|
@ -16,7 +16,7 @@ use msg::constellation_msg::PipelineId;
|
|||
|
||||
use collections::BTreeMap;
|
||||
use core::cell::RefCell;
|
||||
use serialize::json::{self, Json, ToJson};
|
||||
use rustc_serialize::json::{self, Json, ToJson};
|
||||
use std::old_io::TcpStream;
|
||||
use std::num::Float;
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
|
|
|
@ -13,7 +13,7 @@ use protocol::JsonPacketStream;
|
|||
|
||||
use collections::BTreeMap;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use serialize::json::{self, Json, ToJson};
|
||||
use rustc_serialize::json::{self, Json, ToJson};
|
||||
use std::cell::RefCell;
|
||||
use std::old_io::TcpStream;
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
|
|
|
@ -10,7 +10,7 @@ use actor::{Actor, ActorRegistry};
|
|||
use actors::tab::{TabActor, TabActorMsg};
|
||||
use protocol::JsonPacketStream;
|
||||
|
||||
use serialize::json;
|
||||
use rustc_serialize::json;
|
||||
use std::old_io::TcpStream;
|
||||
|
||||
#[derive(RustcEncodable)]
|
||||
|
|
|
@ -11,7 +11,7 @@ use actors::console::ConsoleActor;
|
|||
use devtools_traits::DevtoolScriptControlMsg::WantsLiveNotifications;
|
||||
use protocol::JsonPacketStream;
|
||||
|
||||
use serialize::json;
|
||||
use rustc_serialize::json;
|
||||
use std::old_io::TcpStream;
|
||||
|
||||
#[derive(RustcEncodable)]
|
||||
|
|
|
@ -22,8 +22,7 @@ extern crate log;
|
|||
extern crate collections;
|
||||
extern crate core;
|
||||
extern crate devtools_traits;
|
||||
extern crate "serialize" as rustc_serialize;
|
||||
extern crate serialize;
|
||||
extern crate "rustc-serialize" as rustc_serialize;
|
||||
extern crate msg;
|
||||
extern crate time;
|
||||
extern crate util;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
//! [JSON packets]
|
||||
//! (https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport#JSON_Packets).
|
||||
|
||||
use serialize::{json, Encodable};
|
||||
use serialize::json::Json;
|
||||
use rustc_serialize::{json, Encodable};
|
||||
use rustc_serialize::json::Json;
|
||||
use std::old_io::{IoError, OtherIoError, EndOfFile, TcpStream, IoResult};
|
||||
use std::num;
|
||||
|
||||
|
@ -39,7 +39,7 @@ impl JsonPacketStream for TcpStream {
|
|||
let packet_buf = self.read_exact(packet_len).unwrap();
|
||||
let packet = String::from_utf8(packet_buf).unwrap();
|
||||
println!("{}", packet);
|
||||
return Ok(json::from_str(packet.as_slice()).unwrap())
|
||||
return Ok(Json::from_str(packet.as_slice()).unwrap())
|
||||
},
|
||||
Err(ref e) if e.kind == EndOfFile =>
|
||||
return Err(IoError { kind: EndOfFile, desc: "EOF", detail: None }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue