Skip to content

Commit 7c33859

Browse files
committed
can: Switch to crate internal sealed trait
1 parent 9d321f0 commit 7c33859

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/can.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,23 @@ use bxcan::RegisterBlock;
2222

2323
use cfg_if::cfg_if;
2424

25-
mod sealed {
26-
pub trait Sealed {}
27-
}
28-
2925
/// Marker trait for pins (with specific AF mode) that can be used as a CAN RX pin.
30-
pub trait RxPin: sealed::Sealed {}
26+
pub trait RxPin: crate::private::Sealed {}
3127

3228
/// Marker trait for pins (with specific AF mode) that can be used as a CAN TX pin.
33-
pub trait TxPin: sealed::Sealed {}
29+
pub trait TxPin: crate::private::Sealed {}
3430

3531
cfg_if! {
3632
if #[cfg(any(feature = "gpio-f302", feature = "gpio-f303"))] {
3733
use crate::gpio::gpiod;
3834

39-
impl sealed::Sealed for gpioa::PA11<AF9<PushPull>> {}
4035
impl RxPin for gpioa::PA11<AF9<PushPull>> {}
41-
impl sealed::Sealed for gpioa::PA12<AF9<PushPull>> {}
4236
impl TxPin for gpioa::PA12<AF9<PushPull>> {}
4337

44-
impl sealed::Sealed for gpiob::PB8<AF9<PushPull>> {}
4538
impl RxPin for gpiob::PB8<AF9<PushPull>> {}
46-
impl sealed::Sealed for gpiob::PB9<AF9<PushPull>> {}
4739
impl TxPin for gpiob::PB9<AF9<PushPull>> {}
4840

49-
impl sealed::Sealed for gpiod::PD0<AF7<PushPull>> {}
5041
impl RxPin for gpiod::PD0<AF7<PushPull>> {}
51-
impl sealed::Sealed for gpiod::PD1<AF7<PushPull>> {}
5242
impl TxPin for gpiod::PD1<AF7<PushPull>> {}
5343
}
5444
}

0 commit comments

Comments
 (0)