Enable clippy::useless_conversion (#8767)

This PR enables the
[`clippy::useless_conversion`](https://rust-lang.github.io/rust-clippy/master/index.html#/useless_conversion)
rule and fixes the outstanding violations.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-03-03 10:22:55 -05:00 committed by GitHub
parent 20d133322a
commit fe04f69caf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 53 additions and 66 deletions

View file

@ -158,11 +158,11 @@ impl TerminalSize {
}
pub fn num_lines(&self) -> usize {
f32::from((self.size.height / self.line_height).floor()) as usize
(self.size.height / self.line_height).floor() as usize
}
pub fn num_columns(&self) -> usize {
f32::from((self.size.width / self.cell_width).floor()) as usize
(self.size.width / self.cell_width).floor() as usize
}
pub fn height(&self) -> Pixels {
@ -1663,9 +1663,9 @@ mod tests {
fn get_cells(size: TerminalSize, rng: &mut ThreadRng) -> Vec<Vec<char>> {
let mut cells = Vec::new();
for _ in 0..(f32::from(size.height() / size.line_height()) as usize) {
for _ in 0..((size.height() / size.line_height()) as usize) {
let mut row_vec = Vec::new();
for _ in 0..(f32::from(size.width() / size.cell_width()) as usize) {
for _ in 0..((size.width() / size.cell_width()) as usize) {
let cell_char = rng.sample(Alphanumeric) as char;
row_vec.push(cell_char)
}