on master help sign in
Fix clippy lints.
commit29f1be91a2f954f719cb654f5d14d8e549a54755 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 11 Aug 2020, 23:22 (6 years ago) parent4733afa
1 file changed+4−7
helix-term/src/editor.rs+4−7
helix-term/src/editor.rs+4−7
@@ -22,21 +22,19 @@ pub struct BufferComponent<'a> {
2222
2323impl BufferComponent<'_> {
2424 pub fn render(&self) {
25− let mut line_count = 0;
26− for line in &self.contents {
25+ for (n, line) in self.contents.iter().enumerate() {
2726 execute!(
2827 stdout(),
2928 SetForegroundColor(Color::DarkCyan),
30− cursor::MoveTo(self.x, self.y + line_count),
31− Print((line_count + 1).to_string())
29+ cursor::MoveTo(self.x, self.y + n as u16),
30+ Print((n + 1).to_string())
3231 );
3332 execute!(
3433 stdout(),
3534 SetForegroundColor(Color::Reset),
36− cursor::MoveTo(self.x + 2, self.y + line_count),
35+ cursor::MoveTo(self.x + 2, self.y + n as u16),
3736 Print(line)
3837 );
39− line_count += 1;
4038 }
4139 }
4240}
@@ -129,7 +127,6 @@ impl Editor {
129127 }
130128 Some(Ok(_)) => {
131129 // unhandled event
132− ()
133130 }
134131 Some(Err(x)) => panic!(x),
135132 None => break,