mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
constellation: Use ? on Option more often.
This commit is contained in:
parent
eb00aa4164
commit
828585c685
1 changed files with 2 additions and 8 deletions
|
@ -167,10 +167,7 @@ impl<'a> Iterator for FullyActiveBrowsingContextsIterator<'a> {
|
||||||
type Item = &'a BrowsingContext;
|
type Item = &'a BrowsingContext;
|
||||||
fn next(&mut self) -> Option<&'a BrowsingContext> {
|
fn next(&mut self) -> Option<&'a BrowsingContext> {
|
||||||
loop {
|
loop {
|
||||||
let browsing_context_id = match self.stack.pop() {
|
let browsing_context_id = self.stack.pop()?;
|
||||||
Some(browsing_context_id) => browsing_context_id,
|
|
||||||
None => return None,
|
|
||||||
};
|
|
||||||
let browsing_context = match self.browsing_contexts.get(&browsing_context_id) {
|
let browsing_context = match self.browsing_contexts.get(&browsing_context_id) {
|
||||||
Some(browsing_context) => browsing_context,
|
Some(browsing_context) => browsing_context,
|
||||||
None => {
|
None => {
|
||||||
|
@ -212,10 +209,7 @@ impl<'a> Iterator for AllBrowsingContextsIterator<'a> {
|
||||||
fn next(&mut self) -> Option<&'a BrowsingContext> {
|
fn next(&mut self) -> Option<&'a BrowsingContext> {
|
||||||
let pipelines = self.pipelines;
|
let pipelines = self.pipelines;
|
||||||
loop {
|
loop {
|
||||||
let browsing_context_id = match self.stack.pop() {
|
let browsing_context_id = self.stack.pop()?;
|
||||||
Some(browsing_context_id) => browsing_context_id,
|
|
||||||
None => return None,
|
|
||||||
};
|
|
||||||
let browsing_context = match self.browsing_contexts.get(&browsing_context_id) {
|
let browsing_context = match self.browsing_contexts.get(&browsing_context_id) {
|
||||||
Some(browsing_context) => browsing_context,
|
Some(browsing_context) => browsing_context,
|
||||||
None => {
|
None => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue