Skip to content

Commit e10b527

Browse files
authored
Fix some more clippy lints (#115)
Signed-off-by: Daniel Egger <[email protected]>
1 parent 27f0782 commit e10b527

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/builder.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,30 @@ impl Builder {
8383
}
8484

8585
/// Set the size of the display. Supported sizes are defined by [DisplaySize].
86-
pub fn size(&self, display_size: DisplaySize) -> Self {
86+
pub fn size(self, display_size: DisplaySize) -> Self {
8787
Self {
8888
display_size,
89-
..*self
89+
..self
9090
}
9191
}
9292

9393
/// Set the I2C address to use. Defaults to 0x3C which is the most common address.
9494
/// The other address specified in the datasheet is 0x3D. Ignored when using SPI interface.
95-
pub fn with_i2c_addr(&self, i2c_addr: u8) -> Self {
96-
Self { i2c_addr, ..*self }
95+
pub fn with_i2c_addr(self, i2c_addr: u8) -> Self {
96+
Self { i2c_addr, ..self }
9797
}
9898

9999
/// Set the rotation of the display to one of four values. Defaults to no rotation. Note that
100100
/// 90º and 270º rotations are not supported by
101101
/// [`TerminalMode`](../mode/terminal/struct.TerminalMode.html).
102-
pub fn with_rotation(&self, rotation: DisplayRotation) -> Self {
103-
Self { rotation, ..*self }
102+
pub fn with_rotation(self, rotation: DisplayRotation) -> Self {
103+
Self { rotation, ..self }
104104
}
105105

106106
/// Finish the builder and use I2C to communicate with the display
107107
///
108108
/// This method consumes the builder and must come last in the method call chain
109-
pub fn connect_i2c<I2C, CommE>(&self, i2c: I2C) -> DisplayMode<RawMode<I2cInterface<I2C>>>
109+
pub fn connect_i2c<I2C, CommE>(self, i2c: I2C) -> DisplayMode<RawMode<I2cInterface<I2C>>>
110110
where
111111
I2C: hal::blocking::i2c::Write<Error = CommE>,
112112
{
@@ -122,7 +122,7 @@ impl Builder {
122122
///
123123
/// This method consumes the builder and must come last in the method call chain
124124
pub fn connect_spi<SPI, DC, CommE, PinE>(
125-
&self,
125+
self,
126126
spi: SPI,
127127
dc: DC,
128128
) -> DisplayMode<RawMode<SpiInterface<SPI, DC>>>

src/displaysize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ pub enum DisplaySize {
1919
impl DisplaySize {
2020
/// Get integral dimensions from DisplaySize
2121
// TODO: Use whatever vec2 impl I decide to use here
22-
pub fn dimensions(&self) -> (u8, u8) {
23-
match *self {
22+
pub fn dimensions(self) -> (u8, u8) {
23+
match self {
2424
DisplaySize::Display128x64 => (128, 64),
2525
DisplaySize::Display128x32 => (128, 32),
2626
DisplaySize::Display96x16 => (96, 16),

src/mode/terminal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ where
139139
DI: DisplayInterface,
140140
{
141141
fn terminal_err(self) -> Result<T, TerminalModeError<DI>> {
142-
self.map_err(|err| InterfaceError(err))
142+
self.map_err(InterfaceError)
143143
}
144144
}
145145

0 commit comments

Comments
 (0)