diff options
| author | LingMan <LingMan@users.noreply.github.com> | 2020-10-13 01:39:47 +0200 |
|---|---|---|
| committer | LingMan <LingMan@users.noreply.github.com> | 2020-10-20 16:42:51 +0200 |
| commit | 13f0f49a4eae04178c0f835c3e86865af3ea3088 (patch) | |
| tree | c95fbd073ac909c71503ef4e707a61c7016ee377 | |
| parent | 9832374f6e378971e1a933362cf9781b121bb845 (diff) | |
| download | rust-13f0f49a4eae04178c0f835c3e86865af3ea3088.tar.gz rust-13f0f49a4eae04178c0f835c3e86865af3ea3088.zip | |
Drop unneeded `mut`
These parameters don't get modified.
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pp.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_ast_pretty/src/pprust/state.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ast_pretty/src/pp.rs b/compiler/rustc_ast_pretty/src/pp.rs index 95f969d7691..56e769ba6b7 100644 --- a/compiler/rustc_ast_pretty/src/pp.rs +++ b/compiler/rustc_ast_pretty/src/pp.rs @@ -390,7 +390,7 @@ impl Printer { self.scan_stack.pop_front().unwrap() } - fn scan_top(&mut self) -> usize { + fn scan_top(&self) -> usize { *self.scan_stack.front().unwrap() } @@ -484,7 +484,7 @@ impl Printer { self.pending_indentation += amount; } - fn get_top(&mut self) -> PrintStackElem { + fn get_top(&self) -> PrintStackElem { *self.print_stack.last().unwrap_or({ &PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) } }) diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index af8f8132780..029a6cb664d 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -63,7 +63,7 @@ impl<'a> Comments<'a> { } pub fn trailing_comment( - &mut self, + &self, span: rustc_span::Span, next_pos: Option<BytePos>, ) -> Option<Comment> { |
