aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf
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 /embassy-nrf
parent985c11fad5d666485b809b846d294a1a2492b370 (diff)
Remove unneeded rustfmt::skip
Diffstat (limited to 'embassy-nrf')
-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
6 files changed, 92 insertions, 46 deletions
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)