Skip to content

Commit

Permalink
perf: possibly properly preallocate memory correctly
Browse files Browse the repository at this point in the history
well, at least i get to remove a #[allow(...)] here
  • Loading branch information
WilliamAnimate committed Dec 12, 2024
1 parent 1502a6d commit d22cf74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ impl Tui<'_> {
}

let line = songs[i + self.scrolling_offset].split('/').last().unwrap_or("");
#[allow(unused_assignments)] let mut entry: String = String::with_capacity(self.width.into());
let mut entry: String = String::with_capacity(self.width.into());
if i == self.cursor_index_queue {
entry = self.draw_highlighted_entry(line)?;
entry.push_str(&self.draw_highlighted_entry(line)?);
} else {
entry = self.draw_entry(line)?;
entry.push_str(&self.draw_entry(line)?);
}
write!(self.handle, "{entry}");
}
Expand Down

0 comments on commit d22cf74

Please sign in to comment.