Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 947a09a

Browse files
committed
Replace if + unwrap with if let in check_stack
1 parent 80139a0 commit 947a09a

File tree

1 file changed

+1
-2
lines changed
  • compiler/rustc_ast_pretty/src

1 file changed

+1
-2
lines changed

compiler/rustc_ast_pretty/src/pp.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,7 @@ impl Printer {
379379
}
380380

381381
fn check_stack(&mut self, k: usize) {
382-
if !self.scan_stack.is_empty() {
383-
let x = *self.scan_stack.front().unwrap();
382+
if let Some(&x) = self.scan_stack.front() {
384383
match self.buf[x].token {
385384
Token::Begin(_) => {
386385
if k > 0 {

0 commit comments

Comments
 (0)