Update serde to 0.8 (fixes #12659)

This commit is contained in:
Anthony Ramine 2016-08-12 14:46:25 +02:00
parent a22913569c
commit 7ad51dcd7a
70 changed files with 919 additions and 778 deletions

View file

@ -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 {
@ -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);
@ -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();

View file

@ -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()
@ -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()),
@ -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()),
@ -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 {

View file

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

View file

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