nrf/gpio: remove DummyPin

This commit is contained in:
Dario Nieuwenhuis 2021-04-10 01:48:37 +02:00
parent c73751a628
commit 402f7f1886

View file

@ -349,31 +349,20 @@ impl<T: Pin> OptionalPin for T {
}
}
// Uninhabited enum, so it's actually impossible to create a DummyPin value.
#[doc(hidden)]
pub enum DummyPin {}
impl Pin for DummyPin {}
impl sealed::Pin for DummyPin {
#[inline]
fn pin_port(&self) -> u8 {
unreachable!()
}
}
#[derive(Clone, Copy, Debug)]
pub struct NoPin;
impl_unborrow!(NoPin);
impl sealed::OptionalPin for NoPin {}
impl OptionalPin for NoPin {
type Pin = DummyPin;
type Pin = AnyPin;
#[inline]
fn pin(&self) -> Option<&DummyPin> {
fn pin(&self) -> Option<&AnyPin> {
None
}
#[inline]
fn pin_mut(&mut self) -> Option<&mut DummyPin> {
fn pin_mut(&mut self) -> Option<&mut AnyPin> {
None
}
}