Skip to content

Commit aa74081

Browse files
bors[bot]Dirbaio
andauthored
Merge #383
383: async: remove useless `+ 'a` in TAITs. r=ryankurte a=Dirbaio These aren't needed, they're already implied by the type having `'a` as a generic param. Co-authored-by: Dario Nieuwenhuis <[email protected]>
2 parents 3b8a4f8 + c231a1d commit aa74081

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

embedded-hal-async/src/delay.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub trait DelayUs {
88
type Error: core::fmt::Debug;
99

1010
/// The future returned by the `delay_us` function.
11-
type DelayUsFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
11+
type DelayUsFuture<'a>: Future<Output = Result<(), Self::Error>>
1212
where
1313
Self: 'a;
1414

@@ -17,7 +17,7 @@ pub trait DelayUs {
1717
fn delay_us(&mut self, us: u32) -> Self::DelayUsFuture<'_>;
1818

1919
/// The future returned by the `delay_ms` function.
20-
type DelayMsFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
20+
type DelayMsFuture<'a>: Future<Output = Result<(), Self::Error>>
2121
where
2222
Self: 'a;
2323

embedded-hal-async/src/digital.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use core::future::Future;
2121
/// Asynchronously wait for GPIO pin state.
2222
pub trait Wait: embedded_hal::digital::ErrorType {
2323
/// The future returned by the `wait_for_high` function.
24-
type WaitForHighFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
24+
type WaitForHighFuture<'a>: Future<Output = Result<(), Self::Error>>
2525
where
2626
Self: 'a;
2727

@@ -33,7 +33,7 @@ pub trait Wait: embedded_hal::digital::ErrorType {
3333
fn wait_for_high<'a>(&'a mut self) -> Self::WaitForHighFuture<'a>;
3434

3535
/// The future returned by `wait_for_low`.
36-
type WaitForLowFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
36+
type WaitForLowFuture<'a>: Future<Output = Result<(), Self::Error>>
3737
where
3838
Self: 'a;
3939

@@ -45,7 +45,7 @@ pub trait Wait: embedded_hal::digital::ErrorType {
4545
fn wait_for_low<'a>(&'a mut self) -> Self::WaitForLowFuture<'a>;
4646

4747
/// The future returned from `wait_for_rising_edge`.
48-
type WaitForRisingEdgeFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
48+
type WaitForRisingEdgeFuture<'a>: Future<Output = Result<(), Self::Error>>
4949
where
5050
Self: 'a;
5151

@@ -56,7 +56,7 @@ pub trait Wait: embedded_hal::digital::ErrorType {
5656
fn wait_for_rising_edge<'a>(&'a mut self) -> Self::WaitForRisingEdgeFuture<'a>;
5757

5858
/// The future returned from `wait_for_falling_edge`.
59-
type WaitForFallingEdgeFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
59+
type WaitForFallingEdgeFuture<'a>: Future<Output = Result<(), Self::Error>>
6060
where
6161
Self: 'a;
6262

@@ -67,7 +67,7 @@ pub trait Wait: embedded_hal::digital::ErrorType {
6767
fn wait_for_falling_edge<'a>(&'a mut self) -> Self::WaitForFallingEdgeFuture<'a>;
6868

6969
/// The future returned from `wait_for_any_edge`.
70-
type WaitForAnyEdgeFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
70+
type WaitForAnyEdgeFuture<'a>: Future<Output = Result<(), Self::Error>>
7171
where
7272
Self: 'a;
7373

embedded-hal-async/src/i2c.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub use embedded_hal::i2c::{
2525
/// Async i2c
2626
pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
2727
/// Future returned by the `read` method.
28-
type ReadFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
28+
type ReadFuture<'a>: Future<Output = Result<(), Self::Error>>
2929
where
3030
Self: 'a;
3131

@@ -50,7 +50,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
5050
fn read<'a>(&'a mut self, address: A, read: &'a mut [u8]) -> Self::ReadFuture<'a>;
5151

5252
/// Future returned by the `write` method.
53-
type WriteFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
53+
type WriteFuture<'a>: Future<Output = Result<(), Self::Error>>
5454
where
5555
Self: 'a;
5656

@@ -73,7 +73,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
7373
fn write<'a>(&'a mut self, address: A, write: &'a [u8]) -> Self::WriteFuture<'a>;
7474

7575
/// Future returned by the `write_read` method.
76-
type WriteReadFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
76+
type WriteReadFuture<'a>: Future<Output = Result<(), Self::Error>>
7777
where
7878
Self: 'a;
7979

@@ -107,7 +107,7 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
107107
) -> Self::WriteReadFuture<'a>;
108108

109109
/// Future returned by the `transaction` method.
110-
type TransactionFuture<'a, 'b>: Future<Output = Result<(), Self::Error>> + 'a
110+
type TransactionFuture<'a, 'b>: Future<Output = Result<(), Self::Error>>
111111
where
112112
Self: 'a,
113113
'b: 'a;

embedded-hal-async/src/spi.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait SpiDevice: ErrorType {
4646
type Bus: ErrorType;
4747

4848
/// Future returned by the `transaction` method.
49-
type TransactionFuture<'a, R, F, Fut>: Future<Output = Result<R, Self::Error>> + 'a
49+
type TransactionFuture<'a, R, F, Fut>: Future<Output = Result<R, Self::Error>>
5050
where
5151
Self: 'a,
5252
R: 'a,
@@ -170,7 +170,7 @@ impl<T: SpiDevice> SpiDevice for &mut T {
170170
/// Flush support for SPI bus
171171
pub trait SpiBusFlush: ErrorType {
172172
/// Future returned by the `flush` method.
173-
type FlushFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
173+
type FlushFuture<'a>: Future<Output = Result<(), Self::Error>>
174174
where
175175
Self: 'a;
176176

@@ -191,7 +191,7 @@ impl<T: SpiBusFlush> SpiBusFlush for &mut T {
191191
/// Read-only SPI bus
192192
pub trait SpiBusRead<Word: 'static + Copy = u8>: SpiBusFlush {
193193
/// Future returned by the `read` method.
194-
type ReadFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
194+
type ReadFuture<'a>: Future<Output = Result<(), Self::Error>>
195195
where
196196
Self: 'a;
197197

@@ -216,7 +216,7 @@ impl<T: SpiBusRead<Word>, Word: 'static + Copy> SpiBusRead<Word> for &mut T {
216216
/// Write-only SPI
217217
pub trait SpiBusWrite<Word: 'static + Copy = u8>: SpiBusFlush {
218218
/// Future returned by the `write` method.
219-
type WriteFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
219+
type WriteFuture<'a>: Future<Output = Result<(), Self::Error>>
220220
where
221221
Self: 'a;
222222

@@ -242,7 +242,7 @@ impl<T: SpiBusWrite<Word>, Word: 'static + Copy> SpiBusWrite<Word> for &mut T {
242242
/// See (the docs on embedded-hal)[embedded_hal::spi::blocking] for important information on SPI Bus vs Device traits.
243243
pub trait SpiBus<Word: 'static + Copy = u8>: SpiBusRead<Word> + SpiBusWrite<Word> {
244244
/// Future returned by the `transfer` method.
245-
type TransferFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
245+
type TransferFuture<'a>: Future<Output = Result<(), Self::Error>>
246246
where
247247
Self: 'a;
248248

@@ -264,7 +264,7 @@ pub trait SpiBus<Word: 'static + Copy = u8>: SpiBusRead<Word> + SpiBusWrite<Word
264264
) -> Self::TransferFuture<'a>;
265265

266266
/// Future returned by the `transfer_in_place` method.
267-
type TransferInPlaceFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
267+
type TransferInPlaceFuture<'a>: Future<Output = Result<(), Self::Error>>
268268
where
269269
Self: 'a;
270270

@@ -381,7 +381,7 @@ where
381381
{
382382
type Bus = BUS;
383383

384-
type TransactionFuture<'a, R, F, Fut> = impl Future<Output = Result<R, Self::Error>> + 'a
384+
type TransactionFuture<'a, R, F, Fut> = impl Future<Output = Result<R, Self::Error>>
385385
where
386386
Self: 'a, R: 'a, F: FnOnce(*mut Self::Bus) -> Fut + 'a,
387387
Fut: Future<Output = Result<R, <Self::Bus as ErrorType>::Error>> + 'a;

0 commit comments

Comments
 (0)