Replace if + unwrap with if let in check_stack

This commit is contained in:
David Tolnay 2022-01-18 19:18:47 -08:00
parent 80139a0f02
commit 947a09a4a8
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -379,8 +379,7 @@ impl Printer {
}
fn check_stack(&mut self, k: usize) {
if !self.scan_stack.is_empty() {
let x = *self.scan_stack.front().unwrap();
if let Some(&x) = self.scan_stack.front() {
match self.buf[x].token {
Token::Begin(_) => {
if k > 0 {