mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
Use Option::unwrap_or instead of open-coding it
This commit is contained in:
parent
f3ab6f0584
commit
61e722f331
@ -491,12 +491,9 @@ impl Printer {
|
||||
}
|
||||
|
||||
fn get_top(&mut self) -> PrintStackElem {
|
||||
match self.print_stack.last() {
|
||||
Some(el) => *el,
|
||||
None => {
|
||||
PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
|
||||
}
|
||||
}
|
||||
*self.print_stack.last().unwrap_or({
|
||||
&PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
|
||||
})
|
||||
}
|
||||
|
||||
fn print_begin(&mut self, b: BeginToken, l: isize) {
|
||||
|
Loading…
Reference in New Issue
Block a user