Use rustc-serialize rather than the built-in deprecated serialize.

This commit is contained in:
Ms2ger 2015-02-17 12:51:16 +01:00
parent 4ab928728e
commit aaed4a54c7
30 changed files with 54 additions and 33 deletions

View file

@ -17,4 +17,5 @@ path = "../msg"
path = "../util"
[dependencies]
time = "*"
time = "*"
rustc-serialize = "0.2"

View file

@ -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.

View file

@ -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};

View file

@ -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};

View file

@ -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)]

View file

@ -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)]

View file

@ -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;

View file

@ -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 }),

View file

@ -15,3 +15,4 @@ path = "../util"
[dependencies]
url = "0.2.16"
rustc-serialize = "0.2"

View file

@ -10,13 +10,12 @@
#![crate_type = "rlib"]
#![feature(int_uint)]
#![feature(rustc_private)]
#![allow(non_snake_case)]
#![allow(missing_copy_implementations)]
extern crate msg;
extern crate "serialize" as rustc_serialize;
extern crate "rustc-serialize" as rustc_serialize;
extern crate url;
extern crate util;

View file

@ -67,3 +67,4 @@ path = "../script_traits"
url = "0.2.16"
time = "0.1.12"
bitflags = "*"
rustc-serialize = "0.2"

View file

@ -31,7 +31,7 @@ extern crate libc;
extern crate stb_image;
extern crate png;
extern crate script_traits;
extern crate "serialize" as rustc_serialize;
extern crate "rustc-serialize" as rustc_serialize;
extern crate unicode;
#[no_link] #[plugin]
extern crate "plugins" as servo_plugins;

View file

@ -59,3 +59,4 @@ git = "https://github.com/servo/rust-png"
encoding = "0.2"
url = "0.2.16"
bitflags = "*"
rustc-serialize = "0.2"

View file

@ -50,7 +50,7 @@ use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect, Size2D};
use gfx::display_list::{ClippingRegion, DisplayList};
use serialize::{Encoder, Encodable};
use rustc_serialize::{Encoder, Encodable};
use msg::compositor_msg::LayerId;
use servo_util::geometry::{Au, MAX_AU};
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};

View file

@ -48,7 +48,7 @@ use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect, Size2D};
use gfx::display_list::ClippingRegion;
use serialize::{Encoder, Encodable};
use rustc_serialize::{Encoder, Encodable};
use msg::compositor_msg::LayerId;
use servo_util::geometry::{Au, ZERO_RECT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};

View file

@ -28,7 +28,7 @@ use gfx::display_list::{BOX_SHADOW_INFLATION_FACTOR, OpaqueNode};
use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice};
use script_traits::UntrustedNodeAddress;
use serialize::{Encodable, Encoder};
use rustc_serialize::{Encodable, Encoder};
use msg::constellation_msg::{PipelineId, SubpageId};
use net::image::holder::ImageHolder;
use net::local_image_cache::LocalImageCache;

View file

@ -9,7 +9,7 @@
use flow_ref::FlowRef;
use flow;
use serialize::json;
use rustc_serialize::json;
use std::borrow::ToOwned;
use std::cell::RefCell;

View file

@ -34,8 +34,7 @@ extern crate gfx;
extern crate layout_traits;
extern crate script;
extern crate script_traits;
extern crate "serialize" as rustc_serialize;
extern crate serialize;
extern crate "rustc-serialize" as rustc_serialize;
extern crate png;
extern crate style;
#[macro_use]

View file

@ -4,7 +4,6 @@
#![feature(hash)]
#![feature(int_uint)]
#![feature(rustc_private)]
#![allow(missing_copy_implementations)]
@ -13,7 +12,6 @@ extern crate azure;
extern crate geom;
extern crate hyper;
extern crate layers;
extern crate serialize;
extern crate util;
extern crate url;

View file

@ -5,7 +5,7 @@
use resource_task::{Metadata, LoadData, TargetedLoadResponse, start_sending, ResponseSenders};
use resource_task::ProgressMsg::{Payload, Done};
use serialize::base64::FromBase64;
use rustc_serialize::base64::FromBase64;
use hyper::mime::Mime;
use url::{percent_decode, SchemeData};

View file

@ -23,7 +23,7 @@ extern crate png;
#[macro_use]
extern crate log;
extern crate openssl;
extern crate "rustc-serialize" as serialize;
extern crate "rustc-serialize" as rustc_serialize;
extern crate util;
extern crate stb_image;
extern crate time;

View file

@ -47,7 +47,7 @@ use js::rust::with_compartment;
use url::{Url, UrlParser};
use libc;
use serialize::base64::{FromBase64, ToBase64, STANDARD};
use rustc_serialize::base64::{FromBase64, ToBase64, STANDARD};
use std::cell::{Ref, RefMut};
use std::default::Default;
use std::ffi::CString;

View file

@ -38,7 +38,7 @@ extern crate js;
extern crate libc;
extern crate msg;
extern crate net;
extern crate "rustc-serialize" as serialize;
extern crate "rustc-serialize" as rustc_serialize;
extern crate time;
extern crate canvas;
extern crate script_traits;

View file

@ -5,7 +5,6 @@
#![feature(core)]
#![feature(int_uint)]
#![feature(libc)]
#![feature(rustc_private)]
#![allow(missing_copy_implementations)]
@ -16,7 +15,6 @@ extern crate msg;
extern crate net;
extern crate util;
extern crate url;
extern crate serialize;
// This module contains traits in script used generically
// in the rest of Servo.

View file

@ -157,6 +157,7 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"msg 0.0.1",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -166,6 +167,7 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -285,7 +287,10 @@ dependencies = [
[[package]]
name = "geom"
version = "0.1.0"
source = "git+https://github.com/servo/rust-geom#e9d7ad3ce613dc152ec06a0cecaee6b628f903a1"
source = "git+https://github.com/servo/rust-geom#6b079ba2738ed15bac2b6ec66850494afb9f2b4c"
dependencies = [
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gfx"
@ -305,6 +310,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
@ -497,6 +503,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
@ -831,6 +838,7 @@ dependencies = [
"lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
"plugins 0.0.1",
"rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",

View file

@ -19,7 +19,6 @@
extern crate collections;
extern crate geom;
extern crate serialize;
extern crate text_writer;
extern crate url;

View file

@ -45,3 +45,4 @@ url = "0.2.16"
time = "0.1.12"
bitflags = "*"
rand = "*"
rustc-serialize = "0.2"

View file

@ -33,7 +33,7 @@ extern crate layers;
extern crate libc;
#[no_link] #[macro_use] extern crate cssparser;
extern crate rand;
extern crate "serialize" as rustc_serialize;
extern crate "rustc-serialize" as rustc_serialize;
#[cfg(target_os="macos")]
extern crate task_info;
extern crate "time" as std_time;

10
ports/cef/Cargo.lock generated
View file

@ -160,6 +160,7 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"msg 0.0.1",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -169,6 +170,7 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -288,7 +290,10 @@ dependencies = [
[[package]]
name = "geom"
version = "0.1.0"
source = "git+https://github.com/servo/rust-geom#e9d7ad3ce613dc152ec06a0cecaee6b628f903a1"
source = "git+https://github.com/servo/rust-geom#6b079ba2738ed15bac2b6ec66850494afb9f2b4c"
dependencies = [
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gfx"
@ -308,6 +313,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
@ -505,6 +511,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
@ -858,6 +865,7 @@ dependencies = [
"lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
"plugins 0.0.1",
"rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",

10
ports/gonk/Cargo.lock generated
View file

@ -125,6 +125,7 @@ version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"msg 0.0.1",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -134,6 +135,7 @@ name = "devtools_traits"
version = "0.0.1"
dependencies = [
"msg 0.0.1",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
]
@ -245,7 +247,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "geom"
version = "0.1.0"
source = "git+https://github.com/servo/rust-geom#e9d7ad3ce613dc152ec06a0cecaee6b628f903a1"
source = "git+https://github.com/servo/rust-geom#6b079ba2738ed15bac2b6ec66850494afb9f2b4c"
dependencies = [
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gfx"
@ -265,6 +270,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"skia 0.0.20130412 (git+https://github.com/servo/skia?branch=upstream-2014-06-16)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
@ -412,6 +418,7 @@ dependencies = [
"net 0.0.1",
"plugins 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"script 0.0.1",
"script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
@ -756,6 +763,7 @@ dependencies = [
"lazy_static 0.1.7 (git+https://github.com/Kimundi/lazy-static.rs)",
"plugins 0.0.1",
"rand 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache)",
"task_info 0.0.1",