mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +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
|
@ -1946,10 +1946,7 @@ impl ScriptThread {
|
|||
pipeline_id: PipelineId)
|
||||
-> Option<DomRoot<WindowProxy>>
|
||||
{
|
||||
let browsing_context_id = match self.ask_constellation_for_browsing_context_id(pipeline_id) {
|
||||
Some(browsing_context_id) => browsing_context_id,
|
||||
None => return None,
|
||||
};
|
||||
let browsing_context_id = self.ask_constellation_for_browsing_context_id(pipeline_id)?;
|
||||
if let Some(window_proxy) = self.window_proxies.borrow().get(&browsing_context_id) {
|
||||
return Some(DomRoot::from_ref(window_proxy));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue