File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 66use super :: v1;
77use 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
1010pub 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 }
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) ]
4242impl < T , E > v1:: OutputPin for OldOutputPin < T >
4343where
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" ) ]
7676pub struct OldInputPin < T > {
7777 pin : T ,
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 }
Original file line number Diff line number Diff line change 55use super :: v1;
66use 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) ]
1010impl < T > v2:: OutputPin for T
1111where
@@ -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) ]
3029impl < T > v2:: StatefulOutputPin for T
3130where
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 }
4139 }
4240}
4341
42+
43+ /// Implementation of fallible `v2::InputPin` for `v1::InputPin` digital traits
4444#[ cfg( feature = "unproven" ) ]
4545#[ allow( deprecated) ]
4646impl < T > v2:: InputPin for T
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 }
You can’t perform that action at this time.
0 commit comments