Skip to content

Commit 147db0f

Browse files
committed
cargo fmt
1 parent 1831277 commit 147db0f

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

esp-hal-common/src/gpio.rs

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
2525
use core::{convert::Infallible, marker::PhantomData};
2626

27+
pub use frunk::hlist::{HList, Plucker};
28+
2729
use crate::peripherals::{GPIO, IO_MUX};
2830
#[cfg(xtensa)]
2931
pub(crate) use crate::rtc_pins;
3032
pub use crate::soc::gpio::*;
31-
pub(crate) use crate::{gpiopin_HList, gpiopin_hlist, analog, gpio};
32-
pub use frunk::hlist::{HList, Plucker };
33-
33+
pub(crate) use crate::{analog, gpio, gpiopin_HList, gpiopin_hlist};
3434

3535
/// Convenience type-alias for a no-pin / don't care - pin
3636
pub type NoPinType = Gpio0<Unknown>;
@@ -1308,14 +1308,19 @@ impl IO<InitialPinHList> {
13081308
}
13091309
}
13101310
impl<T> IO<T> {
1311-
pub fn pluck_pin<const NUM: u8, Remaining>(self) -> (GpioPin<Unknown, NUM>, IO<T::Remainder>)
1311+
pub fn pluck_pin<const NUM: u8, Remaining>(self) -> (GpioPin<Unknown, NUM>, IO<T::Remainder>)
13121312
where
13131313
T: Plucker<GpioPin<Unknown, NUM>, Remaining>,
13141314
GpioPin<Unknown, NUM>: GpioProperties,
13151315
{
13161316
let (pin, remaining_pins) = self.pins.pluck();
1317-
(pin, IO { _io_mux: self._io_mux, pins: remaining_pins })
1318-
1317+
(
1318+
pin,
1319+
IO {
1320+
_io_mux: self._io_mux,
1321+
pins: remaining_pins,
1322+
},
1323+
)
13191324
}
13201325
}
13211326
pub trait GpioProperties {
@@ -1326,6 +1331,7 @@ pub trait GpioProperties {
13261331
}
13271332

13281333
/// ```
1334+
/// #[rustfmt::skip]
13291335
/// let expected = frunk::hlist!(
13301336
/// GpioPin::<Unknown>, 0>::new(),
13311337
/// GpioPin::<Unknown>, 1>::new(),
@@ -1339,20 +1345,23 @@ macro_rules! gpiopin_hlist {
13391345
frunk::hlist![$(GpioPin::<Unknown, $gpionum>::new()),+]
13401346
};
13411347
}
1342-
///```
1348+
/// ```
13431349
/// // This should macro-expand to the same as `Expected`
13441350
/// type GeneratedType = gpio_HList!(0, 1, 2);
13451351
///
1346-
/// // expected expantion
1352+
/// // expected expantion
1353+
/// #[rustfmt::skip]
13471354
/// type ExpectedType = HCons<GpioPin<Unknown, { 0 }>,
1348-
/// HCons<GpioPin<Unknown, { 1 }>,
1349-
/// HCons<GpioPin<Unknown, { 2 }>,
1350-
/// HNil>>>;
1355+
/// HCons<GpioPin<Unknown, { 1 }>,
1356+
/// HCons<GpioPin<Unknown, { 2 }>,
1357+
/// HNil>>>;
13511358
///
13521359
/// // let's set up a means to put the type-checker to use
13531360
/// struct ExpectedMaker;
13541361
/// impl ExpectedMaker {
1355-
/// fn make() -> ExpectedType {unimplemented!()}
1362+
/// fn make() -> ExpectedType {
1363+
/// unimplemented!()
1364+
/// }
13561365
/// }
13571366
///
13581367
/// fn main() {
@@ -1361,7 +1370,7 @@ macro_rules! gpiopin_hlist {
13611370
/// // ...but if it doesn't conform to the actual expansion, this doc-test fails
13621371
/// let test: GeneratedType = ExpectedMaker::make();
13631372
/// }
1364-
///```
1373+
/// ```
13651374
#[macro_export]
13661375
macro_rules! gpiopin_HList {
13671376
($($gpionum:expr),+) => {

esp32s3-hal/examples/blinky_hlist.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
//! Blinky, but manages the pins with an HList from the `frunk` crate
22
//!
3-
//! This assumes that a LED is connected to the pin assigned in the `Blinker`s pin-field
3+
//! This assumes that a LED is connected to the pin assigned in the `Blinker`s
4+
//! pin-field
45
56
#![no_std]
67
#![no_main]
78

89
use esp32s3_hal::{
910
clock::ClockControl,
10-
gpio::{ Output, Plucker, PushPull, Unknown, IO},
11+
gpio::{Output, Plucker, PushPull, Unknown, IO},
1112
peripherals::Peripherals,
1213
prelude::*,
1314
timer::TimerGroup,
@@ -21,7 +22,6 @@ struct Blinker {
2122
pin: GpioPin<Output<PushPull>, 4>,
2223
}
2324

24-
2525
impl Blinker {
2626
fn initialize<T, Remaining>(io: IO<T>) -> (Self, IO<T::Remainder>)
2727
where

0 commit comments

Comments
 (0)