summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs')
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs b/src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs
index 10b9b26bb..4b4664a1c 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs
+++ b/src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs
@@ -80,7 +80,7 @@ impl<'a> Write for Printer<'a> {
fn write_str(&mut self, s: &str) -> fmt::Result {
for line in s.split_inclusive('\n') {
if self.needs_indent {
- match self.buf.chars().rev().skip_while(|ch| *ch == ' ').next() {
+ match self.buf.chars().rev().find(|ch| *ch != ' ') {
Some('\n') | None => {}
_ => self.buf.push('\n'),
}
@@ -113,7 +113,7 @@ impl<'a> Printer<'a> {
}
fn newline(&mut self) {
- match self.buf.chars().rev().skip_while(|ch| *ch == ' ').next() {
+ match self.buf.chars().rev().find(|ch| *ch != ' ') {
Some('\n') | None => {}
_ => writeln!(self).unwrap(),
}