Skip to content

Commit

Permalink
Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
avsaase committed Jun 11, 2024
1 parent af2c4e6 commit 9b31099
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ where
let color = color::Color::White.byte_value().0;

self.command(command::WRITE_BW_DATA)?;
self.data_x_times(color, u32::from(WIDTH) / 8 * u32::from(HEIGHT))?;
self.data_x_times(color, WIDTH / 8 * HEIGHT)?;
Ok(())
}

Expand All @@ -177,7 +177,7 @@ where
let color = color::Color::White.byte_value().1;

self.command(command::WRITE_RED_DATA)?;
self.data_x_times(color, u32::from(WIDTH) / 8 * u32::from(HEIGHT))?;
self.data_x_times(color, WIDTH / 8 * HEIGHT)?;
Ok(())
}

Expand All @@ -193,7 +193,7 @@ where
}

fn use_full_frame(&mut self) -> Result<()> {
self.use_partial_frame(0, 0, u32::from(WIDTH), u32::from(HEIGHT))?;
self.use_partial_frame(0, 0, WIDTH, HEIGHT)?;
Ok(())
}

Expand Down
16 changes: 16 additions & 0 deletions src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ impl<const WIDTH: u32, const HEIGHT: u32, const BUFFER_SIZE: usize>
}
}

impl<const WIDTH: u32, const HEIGHT: u32, const BUFFER_SIZE: usize> Default
for Display<WIDTH, HEIGHT, BUFFER_SIZE, Color>
{
fn default() -> Self {
Self::new()
}
}

impl<const WIDTH: u32, const HEIGHT: u32, const BUFFER_SIZE: usize>
Display<WIDTH, HEIGHT, BUFFER_SIZE, TriColor>
{
Expand Down Expand Up @@ -120,6 +128,14 @@ impl<const WIDTH: u32, const HEIGHT: u32, const BUFFER_SIZE: usize>
}
}

impl<const WIDTH: u32, const HEIGHT: u32, const BUFFER_SIZE: usize> Default
for Display<WIDTH, HEIGHT, BUFFER_SIZE, TriColor>
{
fn default() -> Self {
Self::new()
}
}

impl<const WIDTH: u32, const HEIGHT: u32, const BUFFER_SIZE: usize, C>
Display<WIDTH, HEIGHT, BUFFER_SIZE, C>
where
Expand Down

0 comments on commit 9b31099

Please sign in to comment.