Skip to content

Commit f593acb

Browse files
committed
Fixes for 1.80 clippy.
1 parent 91e254d commit f593acb

File tree

5 files changed

+32
-22
lines changed

5 files changed

+32
-22
lines changed

embedded-hal-nb/src/spi.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ pub use embedded_hal::spi::{
1313
/// - Due to how full duplex SPI works each `read` call must be preceded by a `write` call.
1414
///
1515
/// - `read` calls only return the data received with the last `write` call.
16-
/// Previously received data is discarded
16+
/// Previously received data is discarded
1717
///
1818
/// - Data is only guaranteed to be clocked out when the `read` call succeeds.
19-
/// The slave select line shouldn't be released before that.
19+
/// The slave select line shouldn't be released before that.
2020
///
2121
/// - Some SPIs can work with 8-bit *and* 16-bit words. You can overload this trait with different
22-
/// `Word` types to allow operation in both modes.
22+
/// `Word` types to allow operation in both modes.
2323
pub trait FullDuplex<Word: Copy = u8>: ErrorType {
2424
/// Reads the word stored in the shift register
2525
///

embedded-hal/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,37 @@ or a console to operate either on hardware serial ports or on virtual ones like
3737
The HAL
3838

3939
- Must *erase* device specific details. Neither register, register blocks, nor magic values should
40-
appear in the API.
40+
appear in the API.
4141

4242
- Must be generic *within* a device and *across* devices. The API to use a serial interface must
43-
be the same regardless of whether the implementation uses the USART1 or UART4 peripheral of a
44-
device or the UART0 peripheral of another device.
43+
be the same regardless of whether the implementation uses the USART1 or UART4 peripheral of a
44+
device or the UART0 peripheral of another device.
4545

4646
- Where possible must *not* be tied to a specific asynchronous model. The API should be usable
47-
in blocking mode, with the `futures` model, with an async/await model or with a callback model.
48-
(cf. the [`nb`](https://docs.rs/nb) crate)
47+
in blocking mode, with the `futures` model, with an async/await model or with a callback model.
48+
(cf. the [`nb`](https://docs.rs/nb) crate)
4949

5050
- Must be minimal, and thus easy to implement and zero cost, yet highly composable. People that
51-
want higher level abstraction should *prefer to use this HAL* rather than *re-implement*
52-
register manipulation code.
51+
want higher level abstraction should *prefer to use this HAL* rather than *re-implement*
52+
register manipulation code.
5353

5454
- Serve as a foundation for building an ecosystem of platform-agnostic drivers. Here driver
55-
means a library crate that lets a target platform interface an external device like a digital
56-
sensor or a wireless transceiver. The advantage of this system is that by writing the driver as
57-
a generic library on top of `embedded-hal` driver authors can support any number of target
58-
platforms (e.g. Cortex-M microcontrollers, AVR microcontrollers, embedded Linux, etc.). The
59-
advantage for application developers is that by adopting `embedded-hal` they can unlock all
60-
these drivers for their platform.
55+
means a library crate that lets a target platform interface an external device like a digital
56+
sensor or a wireless transceiver. The advantage of this system is that by writing the driver as
57+
a generic library on top of `embedded-hal` driver authors can support any number of target
58+
platforms (e.g. Cortex-M microcontrollers, AVR microcontrollers, embedded Linux, etc.). The
59+
advantage for application developers is that by adopting `embedded-hal` they can unlock all
60+
these drivers for their platform.
6161

6262
- Trait methods must be fallible so that they can be used in any possible situation.
63-
Nevertheless, HAL implementations can additionally provide infallible versions of the same methods
64-
if they can never fail in their platform. This way, generic code can use the fallible abstractions
65-
provided here but platform-specific code can avoid fallibility-related boilerplate if possible.
63+
Nevertheless, HAL implementations can additionally provide infallible versions of the same methods
64+
if they can never fail in their platform. This way, generic code can use the fallible abstractions
65+
provided here but platform-specific code can avoid fallibility-related boilerplate if possible.
6666

6767
## Out of scope
6868

6969
- Initialization and configuration stuff like "ensure this serial interface and that SPI
70-
interface are not using the same pins". The HAL will focus on *doing I/O*.
70+
interface are not using the same pins". The HAL will focus on *doing I/O*.
7171

7272
## Platform agnostic drivers
7373

embedded-io-adapters/src/futures_03.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
//! Adapters to/from `futures::io` traits.
22
3+
// MSRV is 1.60 if you don't enable async, 1.80 if you do.
4+
// Cargo.toml has 1.60, which makes Clippy complain that `poll_fn` was introduced
5+
// in 1.64. So, just silence it for this file.
6+
#![allow(clippy::incompatible_msrv)]
7+
38
use core::future::poll_fn;
49
use core::pin::Pin;
510

embedded-io-adapters/src/tokio_1.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
//! Adapters to/from `tokio::io` traits.
22
3+
// MSRV is 1.60 if you don't enable async, 1.80 if you do.
4+
// Cargo.toml has 1.60, which makes Clippy complain that `poll_fn` was introduced
5+
// in 1.64. So, just silence it for this file.
6+
#![allow(clippy::incompatible_msrv)]
7+
38
use core::future::poll_fn;
49
use core::pin::Pin;
510
use core::task::Poll;

embedded-io/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ targets.
1515
## Differences with `std::io`
1616

1717
- `Error` is an associated type. This allows each implementor to return its own error type,
18-
while avoiding `dyn` or `Box`. This is consistent with how errors are handled in [`embedded-hal`](https://github.com/rust-embedded/embedded-hal/).
18+
while avoiding `dyn` or `Box`. This is consistent with how errors are handled in [`embedded-hal`](https://github.com/rust-embedded/embedded-hal/).
1919
- In `std::io`, the `Read`/`Write` traits might be blocking or non-blocking (i.e. returning `WouldBlock` errors) depending on the file descriptor's mode, which is only known at run-time. This allows passing a non-blocking stream to code that expects a blocking
20-
stream, causing unexpected errors. To solve this, `embedded-io` specifies `Read`/`Write` are always blocking, and adds new `ReadReady`/`WriteReady` traits to allow using streams in a non-blocking way.
20+
stream, causing unexpected errors. To solve this, `embedded-io` specifies `Read`/`Write` are always blocking, and adds new `ReadReady`/`WriteReady` traits to allow using streams in a non-blocking way.
2121

2222
## Optional Cargo features
2323

0 commit comments

Comments
 (0)