Skip to content

Commit d4d93d1

Browse files
committed
Fix clippy warnings
1 parent 2379d33 commit d4d93d1

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

examples/spi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ fn main() -> ! {
4949

5050
// Create an `u8` array, which can be transfered via SPI.
5151
let msg_send: [u8; 8] = [0xD, 0xE, 0xA, 0xD, 0xB, 0xE, 0xE, 0xF];
52-
// Clone the array, as it would be mutually shared in `transfer` while simultaniously would be
52+
// Copy the array, as it would be mutually shared in `transfer` while simultaneously would be
5353
// immutable shared in `assert_eq`.
54-
let mut msg_sending = msg_send.clone();
54+
let mut msg_sending = msg_send;
5555
// Transfer the content of the array via SPI and receive it's output.
5656
// When MOSI and MISO pins are connected together, `msg_received` should receive the content.
5757
// from `msg_sending`

src/i2c.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use crate::time::Hertz;
2727

2828
/// I2C error
2929
#[derive(Debug)]
30+
#[non_exhaustive]
3031
pub enum Error {
3132
/// Bus error
3233
Bus,
@@ -36,8 +37,6 @@ pub enum Error {
3637
// Pec, // SMBUS mode only
3738
// Timeout, // SMBUS mode only
3839
// Alert, // SMBUS mode only
39-
#[doc(hidden)]
40-
_Extensible,
4140
}
4241

4342
// FIXME these should be "closed" traits

src/serial.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub enum Event {
5252

5353
/// Serial error
5454
#[derive(Debug)]
55+
#[non_exhaustive]
5556
pub enum Error {
5657
/// Framing error
5758
Framing,
@@ -61,8 +62,6 @@ pub enum Error {
6162
Overrun,
6263
/// Parity check error
6364
Parity,
64-
#[doc(hidden)]
65-
_Extensible,
6665
}
6766

6867
// FIXME these should be "closed" traits

src/spi.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ use crate::time::Hertz;
4949

5050
/// SPI error
5151
#[derive(Debug)]
52+
#[non_exhaustive]
5253
pub enum Error {
5354
/// Overrun occurred
5455
Overrun,
5556
/// Mode fault occurred
5657
ModeFault,
5758
/// CRC error
5859
Crc,
59-
#[doc(hidden)]
60-
_Extensible,
6160
}
6261

6362
// FIXME these should be "closed" traits

0 commit comments

Comments
 (0)