Rollup merge of #79325 - LingMan:try_op, r=jonas-schievink
Reduce boilerplate with the `?` operator `@rustbot` modify labels to +C-cleanup.
This commit is contained in:
commit
b4db342f51
2 changed files with 9 additions and 17 deletions
|
@ -2372,13 +2372,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