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:
parent
20d133322a
commit
fe04f69caf
30 changed files with 53 additions and 66 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue