Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
spoutn1k committed Oct 11, 2024
1 parent dde9132 commit 8c7038e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/draw_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ impl Drop for DrawStateWrapper<'_> {
orphaned.extend(
self.state
.lines
.to_owned()
.into_iter()
.filter(|l| matches!(l, LineType::Text(_) | LineType::Empty)),
.iter()
.filter(|l| matches!(l, LineType::Text(_) | LineType::Empty))
.cloned(),
);
}
}
Expand Down Expand Up @@ -534,9 +534,11 @@ impl DrawState {
let term_width = term.width() as usize;

// The number of text lines that are contained in this draw state
let text_line_count = self.lines.iter().fold(0, |acc, line| {
acc + matches!(line, LineType::Text(_) | LineType::Empty) as usize
});
let text_line_count = self
.lines
.iter()
.filter(|line| matches!(line, LineType::Text(_) | LineType::Empty))
.count();
// The number of bar lines that are contained in this draw state
// let bar_line_count = self.lines.len() - text_line_count;

Expand Down

0 comments on commit 8c7038e

Please sign in to comment.