Reduce boilerplate with the ?
operator
This commit is contained in:
parent
c643dd2ec8
commit
e0871cc0be
2 changed files with 9 additions and 17 deletions
|
@ -2364,13 +2364,9 @@ impl<'o, 'tcx> Iterator for TraitObligationStackList<'o, 'tcx> {
|
|||
type Item = &'o TraitObligationStack<'o, 'tcx>;
|
||||
|
||||
fn next(&mut self) -> Option<&'o TraitObligationStack<'o, 'tcx>> {
|
||||
match self.head {
|
||||
Some(o) => {
|
||||
*self = o.previous;
|
||||
Some(o)
|
||||
}
|
||||
None => None,
|
||||
}
|
||||
let o = self.head?;
|
||||
*self = o.previous;
|
||||
Some(o)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue