Skip to content

Commit

Permalink
Update serde to 0.8 (fixes #12659)
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Aug 12, 2016
1 parent a229135 commit 7ad51dc
Show file tree
Hide file tree
Showing 70 changed files with 919 additions and 778 deletions.
6 changes: 3 additions & 3 deletions components/canvas/Cargo.toml
Expand Up @@ -12,13 +12,13 @@ path = "lib.rs"
[dependencies]
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
canvas_traits = {path = "../canvas_traits"}
euclid = "0.8.2"
euclid = "0.9"
gfx_traits = {path = "../gfx_traits"}
gleam = "0.2.8"
ipc-channel = "0.4.0"
ipc-channel = "0.5"
log = "0.3.5"
num-traits = "0.1.32"
offscreen_gl_context = "0.2.0"
offscreen_gl_context = "0.3"
plugins = {path = "../plugins"}
util = {path = "../util"}

Expand Down
10 changes: 5 additions & 5 deletions components/canvas_traits/Cargo.toml
Expand Up @@ -11,15 +11,15 @@ path = "lib.rs"

[dependencies]
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
cssparser = {version = "0.5.4", features = ["heap_size", "serde-serialization"]}
euclid = "0.8.2"
cssparser = {version = "0.5.7", features = ["heap_size", "serde-serialization"]}
euclid = "0.9"
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
ipc-channel = "0.4.0"
ipc-channel = "0.5"
plugins = {path = "../plugins"}
serde = {version = "0.7.15", features = ["nightly"]}
serde_macros = "0.7.15"
serde = {version = "0.8", features = ["unstable"]}
serde_macros = "0.8"

[dependencies.webrender_traits]
git = "https://github.com/servo/webrender_traits"
Expand Down
12 changes: 6 additions & 6 deletions components/compositing/Cargo.toml
Expand Up @@ -10,25 +10,25 @@ name = "compositing"
path = "lib.rs"

[dependencies]
app_units = "0.2.5"
app_units = "0.3"
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
euclid = "0.8.2"
euclid = "0.9"
gfx_traits = {path = "../gfx_traits"}
gleam = "0.2.8"
image = "0.10"
ipc-channel = "0.4.0"
ipc-channel = "0.5"
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
script_traits = {path = "../script_traits"}
serde = "0.7.15"
serde_macros = "0.7.15"
serde = "0.8"
serde_macros = "0.8"
style_traits = {path = "../style_traits"}
time = "0.1.17"
url = {version = "1.0.0", features = ["heap_size"]}
url = {version = "1.2", features = ["heap_size"]}
util = {path = "../util"}

[dependencies.webrender]
Expand Down
12 changes: 6 additions & 6 deletions components/constellation/Cargo.toml
Expand Up @@ -15,24 +15,24 @@ canvas = {path = "../canvas"}
canvas_traits = {path = "../canvas_traits"}
compositing = {path = "../compositing"}
devtools_traits = {path = "../devtools_traits"}
euclid = "0.8.2"
euclid = "0.9"
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
ipc-channel = "0.4.0"
ipc-channel = "0.5"
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
layout_traits = {path = "../layout_traits"}
log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.2.0"
offscreen_gl_context = "0.3"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
rand = "0.3"
script_traits = {path = "../script_traits"}
serde = "0.7.15"
serde_macros = "0.7.15"
serde = "0.8"
serde_macros = "0.8"
style_traits = {path = "../style_traits"}
url = {version = "1.0.0", features = ["heap_size"]}
url = {version = "1.2", features = ["heap_size"]}
util = {path = "../util"}

[dependencies.webrender_traits]
Expand Down
11 changes: 6 additions & 5 deletions components/devtools/Cargo.toml
Expand Up @@ -11,13 +11,14 @@ path = "lib.rs"

[dependencies]
devtools_traits = {path = "../devtools_traits"}
hyper = { version = "0.9.9", features = [ "serde-serialization" ] }
ipc-channel = "0.4.0"
hyper = "0.9.9"
hyper_serde = "0.1.4"
ipc-channel = "0.5"
log = "0.3.5"
msg = {path = "../msg"}
plugins = {path = "../plugins"}
serde = "0.7.15"
serde_json = "0.7"
serde_macros = "0.7.15"
serde = "0.8"
serde_json = "0.8"
serde_macros = "0.8"
time = "0.1"
util = {path = "../util"}
4 changes: 2 additions & 2 deletions components/devtools/actor.rs
Expand Up @@ -153,12 +153,12 @@ impl ActorRegistry {
msg: &BTreeMap<String, Value>,
stream: &mut TcpStream)
-> Result<(), ()> {
let to = msg.get("to").unwrap().as_string().unwrap();
let to = msg.get("to").unwrap().as_str().unwrap();

match self.actors.get(to) {
None => debug!("message received for unknown actor \"{}\"", to),
Some(actor) => {
let msg_type = msg.get("type").unwrap().as_string().unwrap();
let msg_type = msg.get("type").unwrap().as_str().unwrap();
if try!(actor.handle_message(self, msg_type, msg, stream))
!= ActorMessageStatus::Processed {
debug!("unexpected message type \"{}\" found for actor \"{}\"",
Expand Down
6 changes: 3 additions & 3 deletions components/devtools/actors/console.rs
Expand Up @@ -103,7 +103,7 @@ impl Actor for ConsoleActor {
Ok(match msg_type {
"getCachedMessages" => {
let str_types = msg.get("messageTypes").unwrap().as_array().unwrap().into_iter().map(|json_type| {
json_type.as_string().unwrap()
json_type.as_str().unwrap()
});
let mut message_types = CachedConsoleMessageTypes::empty();
for str_type in str_types {
Expand Down Expand Up @@ -154,7 +154,7 @@ impl Actor for ConsoleActor {
.as_array()
.unwrap_or(&vec!())
.iter()
.map(|listener| listener.as_string().unwrap().to_owned())
.map(|listener| listener.as_str().unwrap().to_owned())
.collect(),
};
stream.write_json_packet(&msg);
Expand All @@ -174,7 +174,7 @@ impl Actor for ConsoleActor {
}

"evaluateJS" => {
let input = msg.get("text").unwrap().as_string().unwrap().to_owned();
let input = msg.get("text").unwrap().as_str().unwrap().to_owned();
let (chan, port) = ipc::channel().unwrap();
self.script_chan.send(DevtoolScriptControlMsg::EvaluateJS(
self.pipeline, input.clone(), chan)).unwrap();
Expand Down
8 changes: 4 additions & 4 deletions components/devtools/actors/inspector.rs
Expand Up @@ -106,7 +106,7 @@ impl Actor for NodeActor {
stream: &mut TcpStream) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
"modifyAttributes" => {
let target = msg.get("to").unwrap().as_string().unwrap();
let target = msg.get("to").unwrap().as_str().unwrap();
let mods = msg.get("modifications").unwrap().as_array().unwrap();
let modifications = mods.iter().map(|json_mod| {
serde_json::from_str(&serde_json::to_string(json_mod).unwrap()).unwrap()
Expand Down Expand Up @@ -310,7 +310,7 @@ impl Actor for WalkerActor {
}

"children" => {
let target = msg.get("node").unwrap().as_string().unwrap();
let target = msg.get("node").unwrap().as_str().unwrap();
let (tx, rx) = ipc::channel().unwrap();
self.script_chan.send(GetChildren(self.pipeline,
registry.actor_to_script(target.to_owned()),
Expand Down Expand Up @@ -478,7 +478,7 @@ impl Actor for PageStyleActor {

//TODO: query script for box layout properties of node (msg.node)
"getLayout" => {
let target = msg.get("node").unwrap().as_string().unwrap();
let target = msg.get("node").unwrap().as_str().unwrap();
let (tx, rx) = ipc::channel().unwrap();
self.script_chan.send(GetLayout(self.pipeline,
registry.actor_to_script(target.to_owned()),
Expand All @@ -493,7 +493,7 @@ impl Actor for PageStyleActor {
} = try!(rx.recv().unwrap().ok_or(()));

let auto_margins = msg.get("autoMargins")
.and_then(&Value::as_boolean).unwrap_or(false);
.and_then(&Value::as_bool).unwrap_or(false);

// http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/styles.js
let msg = GetLayoutReply {
Expand Down
2 changes: 1 addition & 1 deletion components/devtools/actors/tab.rs
Expand Up @@ -94,7 +94,7 @@ impl Actor for TabActor {
"reconfigure" => {
if let Some(options) = msg.get("options").and_then(|o| o.as_object()) {
if let Some(val) = options.get("performReload") {
if val.as_boolean().unwrap_or(false) {
if val.as_bool().unwrap_or(false) {
let console_actor = registry.find::<ConsoleActor>(&self.console);
let _ = console_actor.script_chan.send(
DevtoolScriptControlMsg::Reload(console_actor.pipeline));
Expand Down
4 changes: 2 additions & 2 deletions components/devtools/actors/timeline.rs
Expand Up @@ -191,14 +191,14 @@ impl Actor for TimelineActor {

// init memory actor
if let Some(with_memory) = msg.get("withMemory") {
if let Some(true) = with_memory.as_boolean() {
if let Some(true) = with_memory.as_bool() {
*self.memory_actor.borrow_mut() = Some(MemoryActor::create(registry));
}
}

// init framerate actor
if let Some(with_ticks) = msg.get("withTicks") {
if let Some(true) = with_ticks.as_boolean() {
if let Some(true) = with_ticks.as_bool() {
let framerate_actor = Some(FramerateActor::create(
registry,
self.pipeline.clone(),
Expand Down
3 changes: 0 additions & 3 deletions components/devtools/protocol.rs
Expand Up @@ -86,9 +86,6 @@ impl JsonPacketStream for TcpStream {
serde_json::Error::Syntax(_, l, c) => {
return Err(format!("syntax at {}:{}", l, c))
},
serde_json::Error::FromUtf8(e) => {
return Err(e.description().to_owned())
},
},
};
},
Expand Down
11 changes: 6 additions & 5 deletions components/devtools_traits/Cargo.toml
Expand Up @@ -13,10 +13,11 @@ path = "lib.rs"
bitflags = "0.7"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
hyper = {version = "0.9.9", features = ["serde-serialization"]}
ipc-channel = "0.4.0"
hyper = "0.9.9"
hyper_serde = "0.1.4"
ipc-channel = "0.5"
msg = {path = "../msg"}
serde = "0.7.15"
serde_macros = "0.7.15"
serde = "0.8"
serde_macros = "0.8"
time = "0.1"
url = {version = "1.0.0", features = ["heap_size"]}
url = {version = "1.2", features = ["heap_size"]}
18 changes: 9 additions & 9 deletions components/gfx/Cargo.toml
Expand Up @@ -11,16 +11,16 @@ name = "gfx"
path = "lib.rs"

[dependencies]
app_units = "0.2.5"
app_units = "0.3"
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
bitflags = "0.7"
euclid = "0.8.2"
euclid = "0.9"
fnv = "1.0"
gfx_traits = {path = "../gfx_traits"}
harfbuzz-sys = "0.1"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
ipc-channel = "0.4.0"
ipc-channel = "0.5"
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
lazy_static = "0.2"
libc = "0.2"
Expand All @@ -34,15 +34,15 @@ profile_traits = {path = "../profile_traits"}
rand = "0.3"
range = {path = "../range"}
rustc-serialize = "0.3"
serde = "0.7.15"
serde_macros = "0.7.15"
serde = "0.8"
serde_macros = "0.8"
smallvec = "0.1"
string_cache = {version = "0.2.20", features = ["heap_size"]}
string_cache = {version = "0.2.23", features = ["heap_size"]}
style = {path = "../style"}
style_traits = {path = "../style_traits"}
time = "0.1.12"
unicode-script = {version = "0.1", features = ["harfbuzz"]}
url = {version = "1.0.0", features = ["heap_size"]}
url = {version = "1.2", features = ["heap_size"]}
util = {path = "../util"}
xi-unicode = "0.0.1"

Expand All @@ -54,8 +54,8 @@ features = ["serde_macros"]
[target.'cfg(target_os = "macos")'.dependencies]
byteorder = "0.5"
core-foundation = "0.2"
core-graphics = "0.3"
core-text = "1.1"
core-graphics = "0.4"
core-text = "2.0"

[target.'cfg(any(target_os = "linux", target_os = "android", target_os = "windows"))'.dependencies]
freetype = {git = "https://github.com/servo/rust-freetype"}
Expand Down
8 changes: 6 additions & 2 deletions components/gfx/display_list/mod.rs
Expand Up @@ -31,7 +31,6 @@ use net_traits::image::base::{Image, PixelFormat};
use paint_context::PaintContext;
use range::Range;
use serde::de::{self, Deserialize, Deserializer, MapVisitor, Visitor};
use serde::ser::impls::MapIteratorVisitor;
use serde::ser::{Serialize, Serializer};
use std::cmp::{self, Ordering};
use std::collections::HashMap;
Expand Down Expand Up @@ -161,7 +160,12 @@ impl<K, V> DerefMut for FnvHashMap<K, V> {
impl<K, V> Serialize for FnvHashMap<K, V> where K: Eq + Hash + Serialize, V: Serialize {
#[inline]
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer {
serializer.serialize_map(MapIteratorVisitor::new(self.iter(), Some(self.len())))
let mut state = try!(serializer.serialize_map(Some(self.len())));
for (key, value) in self.iter() {
try!(serializer.serialize_map_key(&mut state, key));
try!(serializer.serialize_map_value(&mut state, value));
}
serializer.serialize_map_end(state)
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/gfx/font_cache_thread.rs
Expand Up @@ -229,7 +229,7 @@ impl FontCache {
Ok(ref metadata) => {
metadata.content_type.as_ref().map_or(false, |content_type| {
let mime = &content_type.0;
is_supported_font_type(&mime.0, &mime.1)
is_supported_font_type(&(mime.0).0, &mime.1)
})
}
Err(_) => false,
Expand Down
6 changes: 3 additions & 3 deletions components/gfx_traits/Cargo.toml
Expand Up @@ -11,7 +11,7 @@ path = "lib.rs"

[dependencies]
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
euclid = "0.8.2"
euclid = "0.9"
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
Expand All @@ -20,5 +20,5 @@ plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rustc-serialize = "0.3"
serde = "0.7.15"
serde_macros = "0.7.15"
serde = "0.8"
serde_macros = "0.8"
14 changes: 7 additions & 7 deletions components/layout/Cargo.toml
Expand Up @@ -10,18 +10,18 @@ name = "layout"
path = "lib.rs"

[dependencies]
app_units = "0.2.5"
app_units = "0.3"
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
cssparser = {version = "0.5.4", features = ["heap_size", "serde-serialization"]}
euclid = "0.8.2"
cssparser = {version = "0.5.7", features = ["heap_size", "serde-serialization"]}
euclid = "0.9"
fnv = "1.0"
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"
heapsize_plugin = "0.1.2"
ipc-channel = "0.4.0"
ipc-channel = "0.5"
libc = "0.2"
log = "0.3.5"
msg = {path = "../msg"}
Expand All @@ -34,14 +34,14 @@ rustc-serialize = "0.3"
script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}
selectors = {version = "0.8", features = ["heap_size"]}
serde_macros = "0.7.15"
serde_macros = "0.8"
smallvec = "0.1"
string_cache = {version = "0.2.20", features = ["heap_size"]}
string_cache = {version = "0.2.23", features = ["heap_size"]}
style = {path = "../style"}
style_traits = {path = "../style_traits"}
unicode-bidi = "0.2"
unicode-script = {version = "0.1", features = ["harfbuzz"]}
url = {version = "1.0.0", features = ["heap_size"]}
url = {version = "1.2", features = ["heap_size"]}
util = {path = "../util"}

[dependencies.webrender_traits]
Expand Down

0 comments on commit 7ad51dc

Please sign in to comment.