diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-23 14:42:50 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-23 14:42:50 -0600 |
commit | f62ab247fcb9e5fb7025dfdaa83f4ebd4084eab1 (patch) | |
tree | 730b4a636a4a64db50e100b04c4a1d12b500232b | |
parent | 5ce7d8accfc52dd37b19b4400a643a980412bb2f (diff) | |
parent | 2764ec0f7bae00c79a754acd68c93983aed93421 (diff) | |
download | servo-f62ab247fcb9e5fb7025dfdaa83f4ebd4084eab1.tar.gz servo-f62ab247fcb9e5fb7025dfdaa83f4ebd4084eab1.zip |
auto merge of #5311 : frewsxcv/servo/handle-message-str, r=jdm
Fixes #5305
-rw-r--r-- | components/devtools/actor.rs | 2 | ||||
-rw-r--r-- | components/devtools/actors/console.rs | 4 | ||||
-rw-r--r-- | components/devtools/actors/inspector.rs | 20 | ||||
-rw-r--r-- | components/devtools/actors/root.rs | 4 | ||||
-rw-r--r-- | components/devtools/actors/tab.rs | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/components/devtools/actor.rs b/components/devtools/actor.rs index 5593a07e8a7..4f197ccb74e 100644 --- a/components/devtools/actor.rs +++ b/components/devtools/actor.rs @@ -18,7 +18,7 @@ use rustc_serialize::json; pub trait Actor: Any { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()>; fn name(&self) -> String; diff --git a/components/devtools/actors/console.rs b/components/devtools/actors/console.rs index 1d753eb928e..e11665745fd 100644 --- a/components/devtools/actors/console.rs +++ b/components/devtools/actors/console.rs @@ -118,10 +118,10 @@ impl Actor for ConsoleActor { fn handle_message(&self, _registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "getCachedMessages" => { let types = msg.get(&"messageTypes".to_string()).unwrap().as_array().unwrap(); let /*mut*/ messages = vec!(); diff --git a/components/devtools/actors/inspector.rs b/components/devtools/actors/inspector.rs index 23409910b62..67c87dbaec8 100644 --- a/components/devtools/actors/inspector.rs +++ b/components/devtools/actors/inspector.rs @@ -66,10 +66,10 @@ impl Actor for HighlighterActor { fn handle_message(&self, _registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, _msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "showBoxModel" => { let msg = ShowBoxModelReply { from: self.name(), @@ -103,10 +103,10 @@ impl Actor for NodeActor { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "modifyAttributes" => { let target = msg.get(&"to".to_string()).unwrap().as_string().unwrap(); let mods = msg.get(&"modifications".to_string()).unwrap().as_array().unwrap(); @@ -277,10 +277,10 @@ impl Actor for WalkerActor { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "querySelector" => { let msg = QuerySelectorReply { from: self.name(), @@ -423,10 +423,10 @@ impl Actor for PageStyleActor { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "getApplied" => { //TODO: query script for relevant applied styles to node (msg.node) let msg = GetAppliedReply { @@ -495,10 +495,10 @@ impl Actor for InspectorActor { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, _msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "getWalker" => { if self.walker.borrow().is_none() { let walker = WalkerActor { diff --git a/components/devtools/actors/root.rs b/components/devtools/actors/root.rs index 06343956c1f..dc1b0204d8b 100644 --- a/components/devtools/actors/root.rs +++ b/components/devtools/actors/root.rs @@ -52,10 +52,10 @@ impl Actor for RootActor { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, _msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "listAddons" => { let actor = ErrorReply { from: "root".to_string(), diff --git a/components/devtools/actors/tab.rs b/components/devtools/actors/tab.rs index b96d8cbfc57..d1524635648 100644 --- a/components/devtools/actors/tab.rs +++ b/components/devtools/actors/tab.rs @@ -77,10 +77,10 @@ impl Actor for TabActor { fn handle_message(&self, registry: &ActorRegistry, - msg_type: &String, + msg_type: &str, _msg: &json::Object, stream: &mut TcpStream) -> Result<bool, ()> { - Ok(match &**msg_type { + Ok(match msg_type { "reconfigure" => { stream.write_json_packet(&ReconfigureReply { from: self.name() }); true |