1
Fork 0

Inline Printer's scan_top method

This commit is contained in:
David Tolnay 2022-01-18 19:15:21 -08:00
parent e20d5abdfb
commit 2a14275500
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -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 {