Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 1145de6

Browse files
committed
Fixed a few clippy lints
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
1 parent 02050a7 commit 1145de6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/i2c.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl<PINS> WriteRead for I2c<I2C1, PINS> {
131131
* and make sure we end a non-NACKed read (i.e. if we found a device) properly */
132132
self.i2c.cr2.modify(|_, w| {
133133
w.sadd()
134-
.bits(addr as u16)
134+
.bits(u16::from(addr))
135135
.nbytes()
136136
.bits(bytes.len() as u8)
137137
.rd_wrn()
@@ -173,7 +173,7 @@ impl<PINS> WriteRead for I2c<I2C1, PINS> {
173173
* and make sure we end a non-NACKed read (i.e. if we found a device) properly */
174174
self.i2c.cr2.modify(|_, w| {
175175
w.sadd()
176-
.bits(addr as u16)
176+
.bits(u16::from(addr))
177177
.nbytes()
178178
.bits(buffer.len() as u8)
179179
.rd_wrn()
@@ -208,7 +208,7 @@ impl<PINS> Write for I2c<I2C1, PINS> {
208208
* and make sure we end a non-NACKed read (i.e. if we found a device) properly */
209209
self.i2c.cr2.modify(|_, w| {
210210
w.sadd()
211-
.bits(addr as u16)
211+
.bits(u16::from(addr))
212212
.nbytes()
213213
.bits(bytes.len() as u8)
214214
.rd_wrn()

0 commit comments

Comments
 (0)