Skip to content

Commit fa83c00

Browse files
committed
Fix clippy warnings
1 parent ee81f83 commit fa83c00

3 files changed

Lines changed: 6 additions & 16 deletions

File tree

src/epd4in2bc/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ where
318318

319319
self.send_data(spi, &[(x >> 8) as u8])?;
320320
self.send_data(spi, &[(x & 0xf8) as u8])?; // x should be the multiple of 8, the last 3 bit will always be ignored
321-
self.send_data(spi, &[((x & 0xf8) + width - 1 >> 8) as u8])?;
322-
self.send_data(spi, &[((x & 0xf8) + width - 1 | 0x07) as u8])?;
321+
self.send_data(spi, &[(((x & 0xf8) + width - 1) >> 8) as u8])?;
322+
self.send_data(spi, &[(((x & 0xf8) + width - 1) | 0x07) as u8])?;
323323

324324
self.send_data(spi, &[(y >> 8) as u8])?;
325325
self.send_data(spi, &[(y & 0xff) as u8])?;

src/graphics.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ use core::marker::PhantomData;
55
use embedded_graphics_core::prelude::*;
66

77
/// Display rotation, only 90° increments supported
8-
#[derive(Clone, Copy)]
8+
#[derive(Default, Clone, Copy)]
99
pub enum DisplayRotation {
1010
/// No rotation
11+
#[default]
1112
Rotate0,
1213
/// Rotate by 90 degrees clockwise
1314
Rotate90,
@@ -17,12 +18,6 @@ pub enum DisplayRotation {
1718
Rotate270,
1819
}
1920

20-
impl Default for DisplayRotation {
21-
fn default() -> Self {
22-
DisplayRotation::Rotate0
23-
}
24-
}
25-
2621
/// DisplayMode carries modes avaiable for color representaion on TriColor displays
2722
/// Each mode contains list of (bw, color) pairs, where bw - value for BW layer, color - value for Chromatic layer
2823
#[repr(u8)]

src/traits.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,16 @@ pub(crate) trait Command: Copy {
1111
}
1212

1313
/// Seperates the different LUT for the Display Refresh process
14-
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
14+
#[derive(Debug, Default, Clone, PartialEq, Eq, Copy)]
1515
pub enum RefreshLut {
1616
/// The "normal" full Lookuptable for the Refresh-Sequence
17+
#[default]
1718
Full,
1819
/// The quick LUT where not the full refresh sequence is followed.
1920
/// This might lead to some
2021
Quick,
2122
}
2223

23-
impl Default for RefreshLut {
24-
fn default() -> Self {
25-
RefreshLut::Full
26-
}
27-
}
28-
2924
pub(crate) trait InternalWiAdditions<SPI, CS, BUSY, DC, RST, DELAY>
3025
where
3126
SPI: Write<u8>,

0 commit comments

Comments
 (0)