aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2021-12-16 11:37:53 +0100
committerUlf Lilleengen <[email protected]>2021-12-16 11:37:53 +0100
commit2bbd1ddb8a0e36e91a2b328024f313b780b1b851 (patch)
tree4e41c56f0032f811faac07bc98f93b522ea2e1f3
parent985c11fad5d666485b809b846d294a1a2492b370 (diff)
Remove unneeded rustfmt::skip
-rw-r--r--embassy-lora/src/sx127x/mod.rs22
-rw-r--r--embassy-nrf/src/gpio.rs36
-rw-r--r--embassy-nrf/src/qspi.rs18
-rw-r--r--embassy-nrf/src/rng.rs6
-rw-r--r--embassy-nrf/src/spim.rs18
-rw-r--r--embassy-nrf/src/twim.rs18
-rw-r--r--embassy-nrf/src/uarte.rs42
-rw-r--r--embassy-stm32/src/i2c/v2.rs27
-rw-r--r--embassy-stm32/src/rng.rs6
-rw-r--r--embassy-stm32/src/sdmmc/v2.rs12
-rw-r--r--embassy-stm32/src/spi/mod.rs18
-rw-r--r--embassy-stm32/src/usart/mod.rs12
-rw-r--r--embassy-traits/src/rng.rs5
13 files changed, 165 insertions, 75 deletions
diff --git a/embassy-lora/src/sx127x/mod.rs b/embassy-lora/src/sx127x/mod.rs
index 7d3280e05..c26628b0f 100644
--- a/embassy-lora/src/sx127x/mod.rs
+++ b/embassy-lora/src/sx127x/mod.rs
@@ -89,8 +89,15 @@ where
89{ 89{
90 type PhyError = Sx127xError; 90 type PhyError = Sx127xError;
91 91
92 #[rustfmt::skip] 92 type TxFuture<'m>
93 type TxFuture<'m> where SPI: 'm, CS: 'm, RESET: 'm, E: 'm, I: 'm, RFS: 'm = impl Future<Output = Result<u32, Self::PhyError>> + 'm; 93 where
94 SPI: 'm,
95 CS: 'm,
96 RESET: 'm,
97 E: 'm,
98 I: 'm,
99 RFS: 'm,
100 = impl Future<Output = Result<u32, Self::PhyError>> + 'm;
94 101
95 fn tx<'m>(&'m mut self, config: TxConfig, buf: &'m [u8]) -> Self::TxFuture<'m> { 102 fn tx<'m>(&'m mut self, config: TxConfig, buf: &'m [u8]) -> Self::TxFuture<'m> {
96 trace!("TX START"); 103 trace!("TX START");
@@ -130,8 +137,15 @@ where
130 } 137 }
131 } 138 }
132 139
133 #[rustfmt::skip] 140 type RxFuture<'m>
134 type RxFuture<'m> where SPI: 'm, CS: 'm, RESET: 'm, E: 'm, I: 'm, RFS: 'm = impl Future<Output = Result<(usize, RxQuality), Self::PhyError>> + 'm; 141 where
142 SPI: 'm,
143 CS: 'm,
144 RESET: 'm,
145 E: 'm,
146 I: 'm,
147 RFS: 'm,
148 = impl Future<Output = Result<(usize, RxQuality), Self::PhyError>> + 'm;
135 149
136 fn rx<'m>(&'m mut self, config: RfConfig, buf: &'m mut [u8]) -> Self::RxFuture<'m> { 150 fn rx<'m>(&'m mut self, config: RfConfig, buf: &'m mut [u8]) -> Self::RxFuture<'m> {
137 trace!("RX START"); 151 trace!("RX START");
diff --git a/embassy-nrf/src/gpio.rs b/embassy-nrf/src/gpio.rs
index 190d8470f..cb06f0971 100644
--- a/embassy-nrf/src/gpio.rs
+++ b/embassy-nrf/src/gpio.rs
@@ -75,8 +75,10 @@ impl<'d, T: Pin> InputPin for Input<'d, T> {
75 75
76#[cfg(feature = "gpiote")] 76#[cfg(feature = "gpiote")]
77impl<'d, T: Pin> embassy::traits::gpio::WaitForHigh for Input<'d, T> { 77impl<'d, T: Pin> embassy::traits::gpio::WaitForHigh for Input<'d, T> {
78 #[rustfmt::skip] 78 type Future<'a>
79 type Future<'a> where Self: 'a = impl Future<Output=()> + Unpin + 'a; 79 where
80 Self: 'a,
81 = impl Future<Output = ()> + Unpin + 'a;
80 82
81 fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> { 83 fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> {
82 self.pin.conf().modify(|_, w| w.sense().high()); 84 self.pin.conf().modify(|_, w| w.sense().high());
@@ -90,8 +92,10 @@ impl<'d, T: Pin> embassy::traits::gpio::WaitForHigh for Input<'d, T> {
90 92
91#[cfg(feature = "gpiote")] 93#[cfg(feature = "gpiote")]
92impl<'d, T: Pin> embassy::traits::gpio::WaitForLow for Input<'d, T> { 94impl<'d, T: Pin> embassy::traits::gpio::WaitForLow for Input<'d, T> {
93 #[rustfmt::skip] 95 type Future<'a>
94 type Future<'a> where Self: 'a = impl Future<Output=()> + Unpin + 'a; 96 where
97 Self: 'a,
98 = impl Future<Output = ()> + Unpin + 'a;
95 99
96 fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> { 100 fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> {
97 self.pin.conf().modify(|_, w| w.sense().low()); 101 self.pin.conf().modify(|_, w| w.sense().low());
@@ -105,8 +109,10 @@ impl<'d, T: Pin> embassy::traits::gpio::WaitForLow for Input<'d, T> {
105 109
106#[cfg(feature = "gpiote")] 110#[cfg(feature = "gpiote")]
107impl<'d, T: Pin> embassy::traits::gpio::WaitForAnyEdge for Input<'d, T> { 111impl<'d, T: Pin> embassy::traits::gpio::WaitForAnyEdge for Input<'d, T> {
108 #[rustfmt::skip] 112 type Future<'a>
109 type Future<'a> where Self: 'a = impl Future<Output=()> + Unpin + 'a; 113 where
114 Self: 'a,
115 = impl Future<Output = ()> + Unpin + 'a;
110 116
111 fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> { 117 fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> {
112 if self.is_high().ok().unwrap() { 118 if self.is_high().ok().unwrap() {
@@ -328,8 +334,10 @@ impl<'d, T: Pin> StatefulOutputPin for FlexPin<'d, T> {
328 334
329#[cfg(feature = "gpiote")] 335#[cfg(feature = "gpiote")]
330impl<'d, T: Pin> embassy::traits::gpio::WaitForHigh for FlexPin<'d, T> { 336impl<'d, T: Pin> embassy::traits::gpio::WaitForHigh for FlexPin<'d, T> {
331 #[rustfmt::skip] 337 type Future<'a>
332 type Future<'a> where Self: 'a = impl Future<Output=()> + Unpin + 'a; 338 where
339 Self: 'a,
340 = impl Future<Output = ()> + Unpin + 'a;
333 341
334 fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> { 342 fn wait_for_high<'a>(&'a mut self) -> Self::Future<'a> {
335 self.pin.conf().modify(|_, w| w.sense().high()); 343 self.pin.conf().modify(|_, w| w.sense().high());
@@ -343,8 +351,10 @@ impl<'d, T: Pin> embassy::traits::gpio::WaitForHigh for FlexPin<'d, T> {
343 351
344#[cfg(feature = "gpiote")] 352#[cfg(feature = "gpiote")]
345impl<'d, T: Pin> embassy::traits::gpio::WaitForLow for FlexPin<'d, T> { 353impl<'d, T: Pin> embassy::traits::gpio::WaitForLow for FlexPin<'d, T> {
346 #[rustfmt::skip] 354 type Future<'a>
347 type Future<'a> where Self: 'a = impl Future<Output=()> + Unpin + 'a; 355 where
356 Self: 'a,
357 = impl Future<Output = ()> + Unpin + 'a;
348 358
349 fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> { 359 fn wait_for_low<'a>(&'a mut self) -> Self::Future<'a> {
350 self.pin.conf().modify(|_, w| w.sense().low()); 360 self.pin.conf().modify(|_, w| w.sense().low());
@@ -358,8 +368,10 @@ impl<'d, T: Pin> embassy::traits::gpio::WaitForLow for FlexPin<'d, T> {
358 368
359#[cfg(feature = "gpiote")] 369#[cfg(feature = "gpiote")]
360impl<'d, T: Pin> embassy::traits::gpio::WaitForAnyEdge for FlexPin<'d, T> { 370impl<'d, T: Pin> embassy::traits::gpio::WaitForAnyEdge for FlexPin<'d, T> {
361 #[rustfmt::skip] 371 type Future<'a>
362 type Future<'a> where Self: 'a = impl Future<Output=()> + Unpin + 'a; 372 where
373 Self: 'a,
374 = impl Future<Output = ()> + Unpin + 'a;
363 375
364 fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> { 376 fn wait_for_any_edge<'a>(&'a mut self) -> Self::Future<'a> {
365 if self.is_high().ok().unwrap() { 377 if self.is_high().ok().unwrap() {
diff --git a/embassy-nrf/src/qspi.rs b/embassy-nrf/src/qspi.rs
index e87094250..56a757c02 100644
--- a/embassy-nrf/src/qspi.rs
+++ b/embassy-nrf/src/qspi.rs
@@ -286,12 +286,18 @@ impl<'d, T: Instance> Drop for Qspi<'d, T> {
286} 286}
287 287
288impl<'d, T: Instance> Flash for Qspi<'d, T> { 288impl<'d, T: Instance> Flash for Qspi<'d, T> {
289 #[rustfmt::skip] 289 type ReadFuture<'a>
290 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Error>> + 'a; 290 where
291 #[rustfmt::skip] 291 Self: 'a,
292 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), Error>> + 'a; 292 = impl Future<Output = Result<(), Error>> + 'a;
293 #[rustfmt::skip] 293 type WriteFuture<'a>
294 type ErasePageFuture<'a> where Self: 'a = impl Future<Output = Result<(), Error>> + 'a; 294 where
295 Self: 'a,
296 = impl Future<Output = Result<(), Error>> + 'a;
297 type ErasePageFuture<'a>
298 where
299 Self: 'a,
300 = impl Future<Output = Result<(), Error>> + 'a;
295 301
296 fn read<'a>(&'a mut self, address: usize, data: &'a mut [u8]) -> Self::ReadFuture<'a> { 302 fn read<'a>(&'a mut self, address: usize, data: &'a mut [u8]) -> Self::ReadFuture<'a> {
297 async move { 303 async move {
diff --git a/embassy-nrf/src/rng.rs b/embassy-nrf/src/rng.rs
index 20d033a12..645f9860e 100644
--- a/embassy-nrf/src/rng.rs
+++ b/embassy-nrf/src/rng.rs
@@ -157,8 +157,10 @@ impl<'d> Drop for Rng<'d> {
157impl<'d> traits::rng::Rng for Rng<'d> { 157impl<'d> traits::rng::Rng for Rng<'d> {
158 type Error = Infallible; 158 type Error = Infallible;
159 159
160 #[rustfmt::skip] // For some reason rustfmt removes the where clause 160 type RngFuture<'a>
161 type RngFuture<'a> where 'd: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 161 where
162 'd: 'a,
163 = impl Future<Output = Result<(), Self::Error>> + 'a;
162 164
163 fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> { 165 fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> {
164 async move { 166 async move {
diff --git a/embassy-nrf/src/spim.rs b/embassy-nrf/src/spim.rs
index e88fb460c..c72c4c5bc 100644
--- a/embassy-nrf/src/spim.rs
+++ b/embassy-nrf/src/spim.rs
@@ -182,8 +182,10 @@ impl<'d, T: Instance> Spi<u8> for Spim<'d, T> {
182} 182}
183 183
184impl<'d, T: Instance> Read<u8> for Spim<'d, T> { 184impl<'d, T: Instance> Read<u8> for Spim<'d, T> {
185 #[rustfmt::skip] 185 type ReadFuture<'a>
186 type ReadFuture<'a> where Self: 'a = impl Future<Output=Result<(), Self::Error>> + 'a; 186 where
187 Self: 'a,
188 = impl Future<Output = Result<(), Self::Error>> + 'a;
187 189
188 fn read<'a>(&'a mut self, data: &'a mut [u8]) -> Self::ReadFuture<'a> { 190 fn read<'a>(&'a mut self, data: &'a mut [u8]) -> Self::ReadFuture<'a> {
189 self.read_write(data, &[]) 191 self.read_write(data, &[])
@@ -191,8 +193,10 @@ impl<'d, T: Instance> Read<u8> for Spim<'d, T> {
191} 193}
192 194
193impl<'d, T: Instance> Write<u8> for Spim<'d, T> { 195impl<'d, T: Instance> Write<u8> for Spim<'d, T> {
194 #[rustfmt::skip] 196 type WriteFuture<'a>
195 type WriteFuture<'a> where Self: 'a = impl Future<Output=Result<(), Self::Error>> + 'a; 197 where
198 Self: 'a,
199 = impl Future<Output = Result<(), Self::Error>> + 'a;
196 200
197 fn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a> { 201 fn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a> {
198 self.read_write(&mut [], data) 202 self.read_write(&mut [], data)
@@ -200,8 +204,10 @@ impl<'d, T: Instance> Write<u8> for Spim<'d, T> {
200} 204}
201 205
202impl<'d, T: Instance> FullDuplex<u8> for Spim<'d, T> { 206impl<'d, T: Instance> FullDuplex<u8> for Spim<'d, T> {
203 #[rustfmt::skip] 207 type WriteReadFuture<'a>
204 type WriteReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 208 where
209 Self: 'a,
210 = impl Future<Output = Result<(), Self::Error>> + 'a;
205 211
206 fn read_write<'a>(&'a mut self, rx: &'a mut [u8], tx: &'a [u8]) -> Self::WriteReadFuture<'a> { 212 fn read_write<'a>(&'a mut self, rx: &'a mut [u8], tx: &'a [u8]) -> Self::WriteReadFuture<'a> {
207 async move { 213 async move {
diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs
index 8173f66b0..d42b88d3b 100644
--- a/embassy-nrf/src/twim.rs
+++ b/embassy-nrf/src/twim.rs
@@ -469,12 +469,18 @@ where
469{ 469{
470 type Error = Error; 470 type Error = Error;
471 471
472 #[rustfmt::skip] 472 type WriteFuture<'a>
473 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 473 where
474 #[rustfmt::skip] 474 Self: 'a,
475 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 475 = impl Future<Output = Result<(), Self::Error>> + 'a;
476 #[rustfmt::skip] 476 type ReadFuture<'a>
477 type WriteReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 477 where
478 Self: 'a,
479 = impl Future<Output = Result<(), Self::Error>> + 'a;
480 type WriteReadFuture<'a>
481 where
482 Self: 'a,
483 = impl Future<Output = Result<(), Self::Error>> + 'a;
478 484
479 fn read<'a>(&'a mut self, address: u8, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> { 485 fn read<'a>(&'a mut self, address: u8, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
480 async move { 486 async move {
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index 17417c0e2..777948198 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -167,8 +167,10 @@ impl<'d, T: Instance> Uarte<'d, T> {
167} 167}
168 168
169impl<'d, T: Instance> Read for Uarte<'d, T> { 169impl<'d, T: Instance> Read for Uarte<'d, T> {
170 #[rustfmt::skip] 170 type ReadFuture<'a>
171 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), TraitError>> + 'a; 171 where
172 Self: 'a,
173 = impl Future<Output = Result<(), TraitError>> + 'a;
172 174
173 fn read<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadFuture<'a> { 175 fn read<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
174 self.rx.read(rx_buffer) 176 self.rx.read(rx_buffer)
@@ -176,8 +178,10 @@ impl<'d, T: Instance> Read for Uarte<'d, T> {
176} 178}
177 179
178impl<'d, T: Instance> Write for Uarte<'d, T> { 180impl<'d, T: Instance> Write for Uarte<'d, T> {
179 #[rustfmt::skip] 181 type WriteFuture<'a>
180 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), TraitError>> + 'a; 182 where
183 Self: 'a,
184 = impl Future<Output = Result<(), TraitError>> + 'a;
181 185
182 fn write<'a>(&'a mut self, tx_buffer: &'a [u8]) -> Self::WriteFuture<'a> { 186 fn write<'a>(&'a mut self, tx_buffer: &'a [u8]) -> Self::WriteFuture<'a> {
183 self.tx.write(tx_buffer) 187 self.tx.write(tx_buffer)
@@ -193,8 +197,10 @@ impl<'d, T: Instance> UarteTx<'d, T> {
193} 197}
194 198
195impl<'d, T: Instance> Write for UarteTx<'d, T> { 199impl<'d, T: Instance> Write for UarteTx<'d, T> {
196 #[rustfmt::skip] 200 type WriteFuture<'a>
197 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), TraitError>> + 'a; 201 where
202 Self: 'a,
203 = impl Future<Output = Result<(), TraitError>> + 'a;
198 204
199 fn write<'a>(&'a mut self, tx_buffer: &'a [u8]) -> Self::WriteFuture<'a> { 205 fn write<'a>(&'a mut self, tx_buffer: &'a [u8]) -> Self::WriteFuture<'a> {
200 async move { 206 async move {
@@ -274,8 +280,10 @@ impl<'d, T: Instance> UarteRx<'d, T> {
274} 280}
275 281
276impl<'d, T: Instance> Read for UarteRx<'d, T> { 282impl<'d, T: Instance> Read for UarteRx<'d, T> {
277 #[rustfmt::skip] 283 type ReadFuture<'a>
278 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), TraitError>> + 'a; 284 where
285 Self: 'a,
286 = impl Future<Output = Result<(), TraitError>> + 'a;
279 287
280 fn read<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadFuture<'a> { 288 fn read<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
281 async move { 289 async move {
@@ -490,8 +498,10 @@ impl<'d, U: Instance, T: TimerInstance> UarteWithIdle<'d, U, T> {
490} 498}
491 499
492impl<'d, U: Instance, T: TimerInstance> ReadUntilIdle for UarteWithIdle<'d, U, T> { 500impl<'d, U: Instance, T: TimerInstance> ReadUntilIdle for UarteWithIdle<'d, U, T> {
493 #[rustfmt::skip] 501 type ReadUntilIdleFuture<'a>
494 type ReadUntilIdleFuture<'a> where Self: 'a = impl Future<Output = Result<usize, TraitError>> + 'a; 502 where
503 Self: 'a,
504 = impl Future<Output = Result<usize, TraitError>> + 'a;
495 fn read_until_idle<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadUntilIdleFuture<'a> { 505 fn read_until_idle<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadUntilIdleFuture<'a> {
496 async move { 506 async move {
497 let ptr = rx_buffer.as_ptr(); 507 let ptr = rx_buffer.as_ptr();
@@ -550,8 +560,10 @@ impl<'d, U: Instance, T: TimerInstance> ReadUntilIdle for UarteWithIdle<'d, U, T
550} 560}
551 561
552impl<'d, U: Instance, T: TimerInstance> Read for UarteWithIdle<'d, U, T> { 562impl<'d, U: Instance, T: TimerInstance> Read for UarteWithIdle<'d, U, T> {
553 #[rustfmt::skip] 563 type ReadFuture<'a>
554 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), TraitError>> + 'a; 564 where
565 Self: 'a,
566 = impl Future<Output = Result<(), TraitError>> + 'a;
555 fn read<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadFuture<'a> { 567 fn read<'a>(&'a mut self, rx_buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
556 async move { 568 async move {
557 self.ppi_ch1.disable(); 569 self.ppi_ch1.disable();
@@ -563,8 +575,10 @@ impl<'d, U: Instance, T: TimerInstance> Read for UarteWithIdle<'d, U, T> {
563} 575}
564 576
565impl<'d, U: Instance, T: TimerInstance> Write for UarteWithIdle<'d, U, T> { 577impl<'d, U: Instance, T: TimerInstance> Write for UarteWithIdle<'d, U, T> {
566 #[rustfmt::skip] 578 type WriteFuture<'a>
567 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), TraitError>> + 'a; 579 where
580 Self: 'a,
581 = impl Future<Output = Result<(), TraitError>> + 'a;
568 582
569 fn write<'a>(&'a mut self, tx_buffer: &'a [u8]) -> Self::WriteFuture<'a> { 583 fn write<'a>(&'a mut self, tx_buffer: &'a [u8]) -> Self::WriteFuture<'a> {
570 self.uarte.write(tx_buffer) 584 self.uarte.write(tx_buffer)
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs
index 94c4d9a7c..73b6f5517 100644
--- a/embassy-stm32/src/i2c/v2.rs
+++ b/embassy-stm32/src/i2c/v2.rs
@@ -858,12 +858,27 @@ impl<'d, T: Instance, TXDMA: super::TxDma<T>, RXDMA: super::RxDma<T>> I2cTrait<u
858{ 858{
859 type Error = super::Error; 859 type Error = super::Error;
860 860
861 #[rustfmt::skip] 861 type WriteFuture<'a>
862 type WriteFuture<'a> where 'd: 'a, T: 'a, TXDMA: 'a, RXDMA: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 862 where
863 #[rustfmt::skip] 863 'd: 'a,
864 type ReadFuture<'a> where 'd: 'a, T: 'a, TXDMA: 'a, RXDMA: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 864 T: 'a,
865 #[rustfmt::skip] 865 TXDMA: 'a,
866 type WriteReadFuture<'a> where 'd: 'a, T: 'a, TXDMA: 'a, RXDMA: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 866 RXDMA: 'a,
867 = impl Future<Output = Result<(), Self::Error>> + 'a;
868 type ReadFuture<'a>
869 where
870 'd: 'a,
871 T: 'a,
872 TXDMA: 'a,
873 RXDMA: 'a,
874 = impl Future<Output = Result<(), Self::Error>> + 'a;
875 type WriteReadFuture<'a>
876 where
877 'd: 'a,
878 T: 'a,
879 TXDMA: 'a,
880 RXDMA: 'a,
881 = impl Future<Output = Result<(), Self::Error>> + 'a;
867 882
868 fn read<'a>(&'a mut self, address: u8, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> { 883 fn read<'a>(&'a mut self, address: u8, buffer: &'a mut [u8]) -> Self::ReadFuture<'a> {
869 self.read_dma(address, buffer, false) 884 self.read_dma(address, buffer, false)
diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs
index 5655ed967..dd059eda7 100644
--- a/embassy-stm32/src/rng.rs
+++ b/embassy-stm32/src/rng.rs
@@ -85,8 +85,10 @@ impl<T: Instance> CryptoRng for Rng<T> {}
85 85
86impl<T: Instance> traits::rng::Rng for Rng<T> { 86impl<T: Instance> traits::rng::Rng for Rng<T> {
87 type Error = Error; 87 type Error = Error;
88 #[rustfmt::skip] 88 type RngFuture<'a>
89 type RngFuture<'a> where Self: 'a = impl Future<Output=Result<(), Self::Error>> + 'a; 89 where
90 Self: 'a,
91 = impl Future<Output = Result<(), Self::Error>> + 'a;
90 92
91 fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> { 93 fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> {
92 unsafe { 94 unsafe {
diff --git a/embassy-stm32/src/sdmmc/v2.rs b/embassy-stm32/src/sdmmc/v2.rs
index 6032c2bb1..5914f92f5 100644
--- a/embassy-stm32/src/sdmmc/v2.rs
+++ b/embassy-stm32/src/sdmmc/v2.rs
@@ -1545,10 +1545,14 @@ mod sdmmc_rs {
1545 1545
1546 impl<'d, T: Instance, P: Pins<T>> BlockDevice for Sdmmc<'d, T, P> { 1546 impl<'d, T: Instance, P: Pins<T>> BlockDevice for Sdmmc<'d, T, P> {
1547 type Error = Error; 1547 type Error = Error;
1548 #[rustfmt::skip] 1548 type ReadFuture<'a>
1549 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 1549 where
1550 #[rustfmt::skip] 1550 Self: 'a,
1551 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 1551 = impl Future<Output = Result<(), Self::Error>> + 'a;
1552 type WriteFuture<'a>
1553 where
1554 Self: 'a,
1555 = impl Future<Output = Result<(), Self::Error>> + 'a;
1552 1556
1553 fn read<'a>( 1557 fn read<'a>(
1554 &'a mut self, 1558 &'a mut self,
diff --git a/embassy-stm32/src/spi/mod.rs b/embassy-stm32/src/spi/mod.rs
index e74b2e157..4ae45a9be 100644
--- a/embassy-stm32/src/spi/mod.rs
+++ b/embassy-stm32/src/spi/mod.rs
@@ -545,8 +545,10 @@ impl<'d, T: Instance, Tx, Rx> traits::Spi<u8> for Spi<'d, T, Tx, Rx> {
545} 545}
546 546
547impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx> traits::Write<u8> for Spi<'d, T, Tx, Rx> { 547impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx> traits::Write<u8> for Spi<'d, T, Tx, Rx> {
548 #[rustfmt::skip] 548 type WriteFuture<'a>
549 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 549 where
550 Self: 'a,
551 = impl Future<Output = Result<(), Self::Error>> + 'a;
550 552
551 fn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a> { 553 fn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a> {
552 self.write_dma_u8(data) 554 self.write_dma_u8(data)
@@ -556,8 +558,10 @@ impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx> traits::Write<u8> for Spi<'d, T,
556impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx: RxDmaChannel<T>> traits::Read<u8> 558impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx: RxDmaChannel<T>> traits::Read<u8>
557 for Spi<'d, T, Tx, Rx> 559 for Spi<'d, T, Tx, Rx>
558{ 560{
559 #[rustfmt::skip] 561 type ReadFuture<'a>
560 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 562 where
563 Self: 'a,
564 = impl Future<Output = Result<(), Self::Error>> + 'a;
561 565
562 fn read<'a>(&'a mut self, data: &'a mut [u8]) -> Self::ReadFuture<'a> { 566 fn read<'a>(&'a mut self, data: &'a mut [u8]) -> Self::ReadFuture<'a> {
563 self.read_dma_u8(data) 567 self.read_dma_u8(data)
@@ -567,8 +571,10 @@ impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx: RxDmaChannel<T>> traits::Read<u8>
567impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx: RxDmaChannel<T>> traits::FullDuplex<u8> 571impl<'d, T: Instance, Tx: TxDmaChannel<T>, Rx: RxDmaChannel<T>> traits::FullDuplex<u8>
568 for Spi<'d, T, Tx, Rx> 572 for Spi<'d, T, Tx, Rx>
569{ 573{
570 #[rustfmt::skip] 574 type WriteReadFuture<'a>
571 type WriteReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), Self::Error>> + 'a; 575 where
576 Self: 'a,
577 = impl Future<Output = Result<(), Self::Error>> + 'a;
572 578
573 fn read_write<'a>( 579 fn read_write<'a>(
574 &'a mut self, 580 &'a mut self,
diff --git a/embassy-stm32/src/usart/mod.rs b/embassy-stm32/src/usart/mod.rs
index a87b7c020..b51a728c0 100644
--- a/embassy-stm32/src/usart/mod.rs
+++ b/embassy-stm32/src/usart/mod.rs
@@ -219,8 +219,10 @@ impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T,
219where 219where
220 TxDma: crate::usart::TxDma<T>, 220 TxDma: crate::usart::TxDma<T>,
221{ 221{
222 #[rustfmt::skip] 222 type WriteFuture<'a>
223 type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>> + 'a; 223 where
224 Self: 'a,
225 = impl Future<Output = Result<(), embassy_traits::uart::Error>> + 'a;
224 226
225 fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a> { 227 fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a> {
226 self.write_dma(buf) 228 self.write_dma(buf)
@@ -232,8 +234,10 @@ impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Read for Uart<'d, T, T
232where 234where
233 RxDma: crate::usart::RxDma<T>, 235 RxDma: crate::usart::RxDma<T>,
234{ 236{
235 #[rustfmt::skip] 237 type ReadFuture<'a>
236 type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>> + 'a; 238 where
239 Self: 'a,
240 = impl Future<Output = Result<(), embassy_traits::uart::Error>> + 'a;
237 241
238 fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a> { 242 fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a> {
239 self.read_dma(buf) 243 self.read_dma(buf)
diff --git a/embassy-traits/src/rng.rs b/embassy-traits/src/rng.rs
index ac4463ee6..ec97406b0 100644
--- a/embassy-traits/src/rng.rs
+++ b/embassy-traits/src/rng.rs
@@ -4,10 +4,9 @@ use core::future::Future;
4pub trait Rng { 4pub trait Rng {
5 type Error; 5 type Error;
6 6
7 #[rustfmt::skip] 7 type RngFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
8 type RngFuture<'a>: Future<Output = Result<(), Self::Error> > + 'a
9 where 8 where
10 Self: 'a; 9 Self: 'a;
11 10
12 /// Completely fill the provided buffer with random bytes. 11 /// Completely fill the provided buffer with random bytes.
13 /// 12 ///