Drop unneeded `mut`

These parameters don't get modified.
This commit is contained in:
LingMan 2020-10-13 01:39:47 +02:00
parent 9832374f6e
commit 13f0f49a4e
2 changed files with 3 additions and 3 deletions

View File

@ -390,7 +390,7 @@ impl Printer {
self.scan_stack.pop_front().unwrap() self.scan_stack.pop_front().unwrap()
} }
fn scan_top(&mut self) -> usize { fn scan_top(&self) -> usize {
*self.scan_stack.front().unwrap() *self.scan_stack.front().unwrap()
} }
@ -484,7 +484,7 @@ impl Printer {
self.pending_indentation += amount; self.pending_indentation += amount;
} }
fn get_top(&mut self) -> PrintStackElem { fn get_top(&self) -> PrintStackElem {
*self.print_stack.last().unwrap_or({ *self.print_stack.last().unwrap_or({
&PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) } &PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
}) })

View File

@ -63,7 +63,7 @@ impl<'a> Comments<'a> {
} }
pub fn trailing_comment( pub fn trailing_comment(
&mut self, &self,
span: rustc_span::Span, span: rustc_span::Span,
next_pos: Option<BytePos>, next_pos: Option<BytePos>,
) -> Option<Comment> { ) -> Option<Comment> {