servo: Merge #18968 - Use try syntax for Option where appropriate (from mbrubeck:try); r=emilio

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they are refactoring only

Source-Repo: https://github.com/servo/servo
Source-Revision: 2b03a9974c61d1481d4b40351ff1305ad0b26588
This commit is contained in:
Matt Brubeck
2017-10-21 03:31:21 -05:00
parent 19e008d015
commit 2e652d8e95
19 changed files with 65 additions and 180 deletions

View File

@@ -1945,10 +1945,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));
}