Skip to content

Commit 7cbdc3f

Browse files
committed
Clean up comments
1 parent a157a54 commit 7cbdc3f

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/digital/v1_compat.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use super::v1;
77
use super::v2;
88

9-
/// Wrapper to allow v2 fallible OutputPin traits to be converted to v1 traits
9+
/// Wrapper to allow fallible `v2::OutputPin` traits to be converted to `v1::OutputPin` traits
1010
pub struct OldOutputPin<T> {
1111
pin: T,
1212
}
@@ -16,12 +16,12 @@ where
1616
T: v2::OutputPin<Error=E>,
1717
E: core::fmt::Debug,
1818
{
19-
/// Create a new OldOutputPin wrapper around a v2::OutputPin
19+
/// Create a new OldOutputPin wrapper around a `v2::OutputPin`
2020
pub fn new(pin: T) -> Self {
2121
Self{pin}
2222
}
2323

24-
/// Fetch a reference to the inner v2::OutputPin impl
24+
/// Fetch a reference to the inner `v2::OutputPin` impl
2525
pub fn inner(&self) -> &T {
2626
&self.pin
2727
}
@@ -37,7 +37,7 @@ where
3737
}
3838
}
3939

40-
/// Implementation of v1 OutputPin trait for v2 fallible output pins
40+
/// Implementation of `v1::OutputPin` trait for fallible `v2::OutputPin` output pins
4141
#[allow(deprecated)]
4242
impl <T, E> v1::OutputPin for OldOutputPin<T>
4343
where
@@ -71,7 +71,7 @@ where
7171
}
7272
}
7373

74-
/// Wrapper to allow v2 fallible InputPin traits to be converted to v1 traits
74+
/// Wrapper to allow fallible `v2::InputPin` traits to be converted to `v1::InputPin` traits
7575
#[cfg(feature = "unproven")]
7676
pub struct OldInputPin<T> {
7777
pin: T,
@@ -88,7 +88,7 @@ where
8888
Self{pin}
8989
}
9090

91-
/// Fetch a reference to the inner v2::InputPin impl
91+
/// Fetch a reference to the inner `v2::InputPin` impl
9292
pub fn inner(&self) -> &T {
9393
&self.pin
9494
}

src/digital/v2_compat.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use super::v1;
66
use super::v2;
77

8-
/// Implementation of v2 fallible OutputPin for v1 traits
8+
/// Implementation of fallible `v2::OutputPin` for `v1::OutputPin` traits
99
#[allow(deprecated)]
1010
impl <T> v2::OutputPin for T
1111
where
@@ -14,24 +14,22 @@ where
1414
// TODO: update to ! when never_type is stabilized
1515
type Error = ();
1616

17-
/// Toggle pin output
1817
fn set_low(&mut self) -> Result<(), Self::Error> {
1918
Ok(self.set_low())
2019
}
2120

22-
fn set_high(&mut self) -> Result<(), Self::Error> {
21+
fn set_high(&mut self) -> Result<(), Self::Error> {
2322
Ok(self.set_high())
2423
}
2524
}
2625

27-
/// Implementation of v2 fallible StatefulOutputPin for v1 digital traits
26+
/// Implementation of fallible `v2::StatefulOutputPin` for `v1::StatefulOutputPin` digital traits
2827
#[cfg(feature = "unproven")]
2928
#[allow(deprecated)]
3029
impl <T> v2::StatefulOutputPin for T
3130
where
3231
T: v1::StatefulOutputPin + v1::OutputPin,
3332
{
34-
/// Toggle pin output
3533
fn is_set_low(&self) -> Result<bool, Self::Error> {
3634
Ok(self.is_set_low())
3735
}
@@ -41,6 +39,8 @@ where
4139
}
4240
}
4341

42+
43+
/// Implementation of fallible `v2::InputPin` for `v1::InputPin` digital traits
4444
#[cfg(feature = "unproven")]
4545
#[allow(deprecated)]
4646
impl <T> v2::InputPin for T
@@ -50,7 +50,6 @@ where
5050
// TODO: update to ! when never_type is stabilized
5151
type Error = ();
5252

53-
/// Toggle pin output
5453
fn is_low(&self) -> Result<bool, Self::Error> {
5554
Ok(self.is_low())
5655
}

0 commit comments

Comments
 (0)