From 2a14275500b5c9cddfab83bb606368a9a4192ea4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 18 Jan 2022 19:15:21 -0800 Subject: [PATCH] Inline Printer's scan_top method --- compiler/rustc_ast_pretty/src/pp.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs index 96d446e3638..4aeb4e4807b 100644 --- a/compiler/rustc_ast_pretty/src/pp.rs +++ b/compiler/rustc_ast_pretty/src/pp.rs @@ -347,10 +347,6 @@ impl Printer { } } - fn scan_top(&self) -> usize { - *self.scan_stack.front().unwrap() - } - fn scan_pop_bottom(&mut self) -> usize { self.scan_stack.pop_back().unwrap() } @@ -388,7 +384,7 @@ impl Printer { fn check_stack(&mut self, k: usize) { if !self.scan_stack.is_empty() { - let x = self.scan_top(); + let x = *self.scan_stack.front().unwrap(); match self.buf[x].token { Token::Begin(_) => { if k > 0 {