mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Use try syntax for Option where appropriate
This commit is contained in:
parent
fe16c1d5c3
commit
2d45e9d2da
19 changed files with 65 additions and 180 deletions
|
@ -317,16 +317,10 @@ fn run_server(sender: Sender<DevtoolsControlMsg>,
|
|||
actor_pipelines: &HashMap<PipelineId, String>) -> Option<String> {
|
||||
let actors = actors.lock().unwrap();
|
||||
if let Some(worker_id) = worker_id {
|
||||
let actor_name = match (*actor_workers).get(&(id, worker_id)) {
|
||||
Some(name) => name,
|
||||
None => return None,
|
||||
};
|
||||
let actor_name = (*actor_workers).get(&(id, worker_id))?;
|
||||
Some(actors.find::<WorkerActor>(actor_name).console.clone())
|
||||
} else {
|
||||
let actor_name = match (*actor_pipelines).get(&id) {
|
||||
Some(name) => name,
|
||||
None => return None,
|
||||
};
|
||||
let actor_name = (*actor_pipelines).get(&id)?;
|
||||
Some(actors.find::<TabActor>(actor_name).console.clone())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue