constellation: Use ? on Option more often.

This commit is contained in:
Emilio Cobos Álvarez 2017-12-09 20:27:31 +01:00
parent eb00aa4164
commit 828585c685
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -167,10 +167,7 @@ impl<'a> Iterator for FullyActiveBrowsingContextsIterator<'a> {
type Item = &'a BrowsingContext;
fn next(&mut self) -> Option<&'a BrowsingContext> {
loop {
let browsing_context_id = match self.stack.pop() {
Some(browsing_context_id) => browsing_context_id,
None => return None,
};
let browsing_context_id = self.stack.pop()?;
let browsing_context = match self.browsing_contexts.get(&browsing_context_id) {
Some(browsing_context) => browsing_context,
None => {
@ -212,10 +209,7 @@ impl<'a> Iterator for AllBrowsingContextsIterator<'a> {
fn next(&mut self) -> Option<&'a BrowsingContext> {
let pipelines = self.pipelines;
loop {
let browsing_context_id = match self.stack.pop() {
Some(browsing_context_id) => browsing_context_id,
None => return None,
};
let browsing_context_id = self.stack.pop()?;
let browsing_context = match self.browsing_contexts.get(&browsing_context_id) {
Some(browsing_context) => browsing_context,
None => {