diff options
-rw-r--r-- | crates/rust-analyzer/src/cli/progress_report.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/rust-analyzer/src/cli/progress_report.rs b/crates/rust-analyzer/src/cli/progress_report.rs index bdbe565e6..5a2dc39d5 100644 --- a/crates/rust-analyzer/src/cli/progress_report.rs +++ b/crates/rust-analyzer/src/cli/progress_report.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! A simple progress bar | 1 | //! A simple progress bar |
2 | //! | 2 | //! |
3 | //! A single thread non-optimized progress bar | 3 | //! A single thread non-optimized progress bar |
4 | use std::io::Write; | 4 | use std::io::{self, Write}; |
5 | 5 | ||
6 | /// A Simple ASCII Progress Bar | 6 | /// A Simple ASCII Progress Bar |
7 | pub(crate) struct ProgressReport { | 7 | pub(crate) struct ProgressReport { |
@@ -97,8 +97,8 @@ impl ProgressReport { | |||
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | let _ = std::io::stdout().write(output.as_bytes()); | 100 | let _ = io::stdout().write(output.as_bytes()); |
101 | let _ = std::io::stdout().flush(); | 101 | let _ = io::stdout().flush(); |
102 | self.text = text.to_string(); | 102 | self.text = text.to_string(); |
103 | } | 103 | } |
104 | 104 | ||
@@ -115,6 +115,8 @@ impl ProgressReport { | |||
115 | let spaces = " ".repeat(self.text.len()); | 115 | let spaces = " ".repeat(self.text.len()); |
116 | let backspaces = "\x08".repeat(self.text.len()); | 116 | let backspaces = "\x08".repeat(self.text.len()); |
117 | print!("{}{}{}", backspaces, spaces, backspaces); | 117 | print!("{}{}{}", backspaces, spaces, backspaces); |
118 | let _ = io::stdout().flush(); | ||
119 | |||
118 | self.text = String::new(); | 120 | self.text = String::new(); |
119 | } | 121 | } |
120 | } | 122 | } |