From a55a9970a5c3d770c31a17d868f84aee2e4a8778 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Sun, 30 May 2021 14:28:09 +0200 Subject: [PATCH] cargo fmt --- examples/epd2in13bc.rs | 2 +- src/graphics.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/epd2in13bc.rs b/examples/epd2in13bc.rs index 69a7ffc..603f3bf 100644 --- a/examples/epd2in13bc.rs +++ b/examples/epd2in13bc.rs @@ -91,7 +91,7 @@ fn main() -> Result<(), std::io::Error> { display.set_rotation(DisplayRotation::Rotate270); draw_text(&mut display, "Rotation 270!", 5, 50); - // Since we only used black and white, we can resort to updating only + // Since we only used black and white, we can resort to updating only // the bw-buffer of this tri-color screen epd2in13 diff --git a/src/graphics.rs b/src/graphics.rs index a752e58..17ea4ec 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -116,7 +116,7 @@ pub trait TriDisplay: DrawTarget { /// return the b/w part of the buffer fn bw_buffer(&self) -> &[u8]; - + /// return the chromatic part of the buffer fn chromatic_buffer(&self) -> &[u8]; @@ -130,12 +130,12 @@ pub trait TriDisplay: DrawTarget { pixel: Pixel, ) -> Result<(), Self::Error> { let rotation = self.rotation(); - + let Pixel(point, color) = pixel; if outside_display(point, width, height, rotation) { return Ok(()); } - + // Give us index inside the buffer and the bit-position in that u8 which needs to be changed let (index, bit) = find_position(point.x as u32, point.y as u32, width, height, rotation); let index = index as usize; @@ -149,19 +149,19 @@ pub trait TriDisplay: DrawTarget { // clear bit in bw-buffer -> black buffer[index] &= !bit; // set bit in chromatic-buffer -> white - buffer[index+offset] |= bit; + buffer[index + offset] |= bit; } TriColor::White => { // set bit in bw-buffer -> white buffer[index] |= bit; // set bit in chromatic-buffer -> white - buffer[index+offset] |= bit; + buffer[index + offset] |= bit; } TriColor::Chromatic => { // set bit in b/w buffer (white) buffer[index] |= bit; // clear bit in chromatic buffer -> chromatic - buffer[index+offset] &= !bit; + buffer[index + offset] &= !bit; } } Ok(())