mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Untry
This commit is contained in:
parent
7af5a7fd54
commit
316cd35767
34 changed files with 261 additions and 264 deletions
|
@ -159,7 +159,7 @@ impl ActorRegistry {
|
|||
None => debug!("message received for unknown actor \"{}\"", to),
|
||||
Some(actor) => {
|
||||
let msg_type = msg.get("type").unwrap().as_str().unwrap();
|
||||
if try!(actor.handle_message(self, msg_type, msg, stream))
|
||||
if actor.handle_message(self, msg_type, msg, stream)?
|
||||
!= ActorMessageStatus::Processed {
|
||||
debug!("unexpected message type \"{}\" found for actor \"{}\"",
|
||||
msg_type, to);
|
||||
|
|
|
@ -115,7 +115,7 @@ impl Actor for ConsoleActor {
|
|||
let (chan, port) = ipc::channel().unwrap();
|
||||
self.script_chan.send(DevtoolScriptControlMsg::GetCachedMessages(
|
||||
self.pipeline, message_types, chan)).unwrap();
|
||||
let messages = try!(port.recv().map_err(|_| ())).into_iter().map(|message| {
|
||||
let messages = port.recv().map_err(|_| ())?.into_iter().map(|message| {
|
||||
let json_string = message.encode().unwrap();
|
||||
let json = serde_json::from_str::<Value>(&json_string).unwrap();
|
||||
json.as_object().unwrap().to_owned()
|
||||
|
@ -179,7 +179,7 @@ impl Actor for ConsoleActor {
|
|||
self.pipeline, input.clone(), chan)).unwrap();
|
||||
|
||||
//TODO: extract conversion into protocol module or some other useful place
|
||||
let result = match try!(port.recv().map_err(|_| ())) {
|
||||
let result = match port.recv().map_err(|_| ())? {
|
||||
VoidValue => {
|
||||
let mut m = Map::new();
|
||||
m.insert("type".to_owned(), Value::String("undefined".to_owned()));
|
||||
|
|
|
@ -289,7 +289,7 @@ impl Actor for WalkerActor {
|
|||
"documentElement" => {
|
||||
let (tx, rx) = ipc::channel().unwrap();
|
||||
self.script_chan.send(GetDocumentElement(self.pipeline, tx)).unwrap();
|
||||
let doc_elem_info = try!(rx.recv().unwrap().ok_or(()));
|
||||
let doc_elem_info = rx.recv().unwrap().ok_or(())?;
|
||||
let node = doc_elem_info.encode(registry, true, self.script_chan.clone(), self.pipeline);
|
||||
|
||||
let msg = DocumentElementReply {
|
||||
|
@ -315,7 +315,7 @@ impl Actor for WalkerActor {
|
|||
registry.actor_to_script(target.to_owned()),
|
||||
tx))
|
||||
.unwrap();
|
||||
let children = try!(rx.recv().unwrap().ok_or(()));
|
||||
let children = rx.recv().unwrap().ok_or(())?;
|
||||
|
||||
let msg = ChildrenReply {
|
||||
hasFirst: true,
|
||||
|
@ -489,7 +489,7 @@ impl Actor for PageStyleActor {
|
|||
borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth,
|
||||
paddingTop, paddingRight, paddingBottom, paddingLeft,
|
||||
width, height,
|
||||
} = try!(rx.recv().unwrap().ok_or(()));
|
||||
} = rx.recv().unwrap().ok_or(())?;
|
||||
|
||||
let auto_margins = msg.get("autoMargins")
|
||||
.and_then(&Value::as_bool).unwrap_or(false);
|
||||
|
@ -563,7 +563,7 @@ impl Actor for InspectorActor {
|
|||
|
||||
let (tx, rx) = ipc::channel().unwrap();
|
||||
self.script_chan.send(GetRootNode(self.pipeline, tx)).unwrap();
|
||||
let root_info = try!(rx.recv().unwrap().ok_or(()));
|
||||
let root_info = rx.recv().unwrap().ok_or(())?;
|
||||
|
||||
let node = root_info.encode(registry, false, self.script_chan.clone(), self.pipeline);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue