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 c1b6c0f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/draw_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ impl Drop for DrawStateWrapper<'_> {
orphaned.extend(
self.state
.lines
.to_owned()
.into_iter()
.iter()
.cloned()
.filter(|l| matches!(l, LineType::Text(_) | LineType::Empty)),
);
}
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 c1b6c0f

Please sign in to comment.