Skip to content

Commit 1dad061

Browse files
Makes the digital::v2::InputPin trait proven
See #41 for more details about this trait. Removes the feature flag from v2 implementation Keeps it on v1 because it would not make sense to prove a deprecated feature.
1 parent 8d520a7 commit 1dad061

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/digital/v1_compat.rs

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ where
108108

109109
/// Wrapper to allow fallible `v2::InputPin` traits to be converted to `v1::InputPin` traits
110110
/// where errors will panic.
111+
///
112+
/// Available behind `"unproven"` feature because `v1::InputPin` is
111113
#[cfg(feature = "unproven")]
112114
pub struct OldInputPin<T> {
113115
pin: T,
@@ -139,6 +141,8 @@ where
139141

140142
/// Implementation of `v1::InputPin` trait for `v2::InputPin` fallible pins
141143
/// where errors will panic.
144+
///
145+
/// Available behind `"unproven"` feature because `v1::InputPin` is
142146
#[cfg(feature = "unproven")]
143147
#[allow(deprecated)]
144148
impl <T, E> v1::InputPin for OldInputPin<T>

src/digital/v2.rs

-3
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ pub mod toggleable {
124124
}
125125

126126
/// Single digital input pin
127-
///
128-
/// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
129-
#[cfg(feature = "unproven")]
130127
pub trait InputPin {
131128
/// Error type
132129
type Error;

src/digital/v2_compat.rs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ where
7676
impl<T> v2::toggleable::Default for T where T: v1::toggleable::Default {}
7777

7878
/// Implementation of fallible `v2::InputPin` for `v1::InputPin` digital traits
79+
///
80+
/// Available behind `"unproven"` feature because `v1::InputPin` is
7981
#[cfg(feature = "unproven")]
8082
#[allow(deprecated)]
8183
impl <T> v2::InputPin for T

0 commit comments

Comments
 (0)