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 6
6
use super :: v1;
7
7
use super :: v2;
8
8
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
10
10
pub struct OldOutputPin < T > {
11
11
pin : T ,
12
12
}
@@ -16,12 +16,12 @@ where
16
16
T : v2:: OutputPin < Error =E > ,
17
17
E : core:: fmt:: Debug ,
18
18
{
19
- /// Create a new OldOutputPin wrapper around a v2::OutputPin
19
+ /// Create a new OldOutputPin wrapper around a ` v2::OutputPin`
20
20
pub fn new ( pin : T ) -> Self {
21
21
Self { pin}
22
22
}
23
23
24
- /// Fetch a reference to the inner v2::OutputPin impl
24
+ /// Fetch a reference to the inner ` v2::OutputPin` impl
25
25
pub fn inner ( & self ) -> & T {
26
26
& self . pin
27
27
}
37
37
}
38
38
}
39
39
40
- /// Implementation of v1 OutputPin trait for v2 fallible output pins
40
+ /// Implementation of `v1:: OutputPin` trait for fallible `v2::OutputPin` output pins
41
41
#[ allow( deprecated) ]
42
42
impl < T , E > v1:: OutputPin for OldOutputPin < T >
43
43
where
71
71
}
72
72
}
73
73
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
75
75
#[ cfg( feature = "unproven" ) ]
76
76
pub struct OldInputPin < T > {
77
77
pin : T ,
88
88
Self { pin}
89
89
}
90
90
91
- /// Fetch a reference to the inner v2::InputPin impl
91
+ /// Fetch a reference to the inner ` v2::InputPin` impl
92
92
pub fn inner ( & self ) -> & T {
93
93
& self . pin
94
94
}
Original file line number Diff line number Diff line change 5
5
use super :: v1;
6
6
use super :: v2;
7
7
8
- /// Implementation of v2 fallible OutputPin for v1 traits
8
+ /// Implementation of fallible `v2:: OutputPin` for `v1::OutputPin` traits
9
9
#[ allow( deprecated) ]
10
10
impl < T > v2:: OutputPin for T
11
11
where
@@ -14,24 +14,22 @@ where
14
14
// TODO: update to ! when never_type is stabilized
15
15
type Error = ( ) ;
16
16
17
- /// Toggle pin output
18
17
fn set_low ( & mut self ) -> Result < ( ) , Self :: Error > {
19
18
Ok ( self . set_low ( ) )
20
19
}
21
20
22
- fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
21
+ fn set_high ( & mut self ) -> Result < ( ) , Self :: Error > {
23
22
Ok ( self . set_high ( ) )
24
23
}
25
24
}
26
25
27
- /// Implementation of v2 fallible StatefulOutputPin for v1 digital traits
26
+ /// Implementation of fallible `v2:: StatefulOutputPin` for `v1::StatefulOutputPin` digital traits
28
27
#[ cfg( feature = "unproven" ) ]
29
28
#[ allow( deprecated) ]
30
29
impl < T > v2:: StatefulOutputPin for T
31
30
where
32
31
T : v1:: StatefulOutputPin + v1:: OutputPin ,
33
32
{
34
- /// Toggle pin output
35
33
fn is_set_low ( & self ) -> Result < bool , Self :: Error > {
36
34
Ok ( self . is_set_low ( ) )
37
35
}
41
39
}
42
40
}
43
41
42
+
43
+ /// Implementation of fallible `v2::InputPin` for `v1::InputPin` digital traits
44
44
#[ cfg( feature = "unproven" ) ]
45
45
#[ allow( deprecated) ]
46
46
impl < T > v2:: InputPin for T
50
50
// TODO: update to ! when never_type is stabilized
51
51
type Error = ( ) ;
52
52
53
- /// Toggle pin output
54
53
fn is_low ( & self ) -> Result < bool , Self :: Error > {
55
54
Ok ( self . is_low ( ) )
56
55
}
You can’t perform that action at this time.
0 commit comments