diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7261970..fd5ff4893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed - +- The current versions of `InputPin` have been proven. These are `digital::v1::InputPin` + and `digital::v2::InputPin`. ## [v0.2.3] - 2019-05-09 diff --git a/src/digital/v1.rs b/src/digital/v1.rs index d7bbfacaa..9c0678b10 100644 --- a/src/digital/v1.rs +++ b/src/digital/v1.rs @@ -131,11 +131,8 @@ pub mod toggleable { /// Single digital input pin /// -/// *This trait is available if embedded-hal is built with the `"unproven"` feature.* -/// /// *This version of the trait is now deprecated. Please use the new `InputPin` trait in /// `digital::v2::InputPin`*. -#[cfg(feature = "unproven")] pub trait InputPin { /// Is the input pin high? fn is_high(&self) -> bool; diff --git a/src/digital/v1_compat.rs b/src/digital/v1_compat.rs index 9de6e93ee..a6689186c 100644 --- a/src/digital/v1_compat.rs +++ b/src/digital/v1_compat.rs @@ -108,12 +108,10 @@ where /// Wrapper to allow fallible `v2::InputPin` traits to be converted to `v1::InputPin` traits /// where errors will panic. -#[cfg(feature = "unproven")] pub struct OldInputPin { pin: T, } -#[cfg(feature = "unproven")] impl OldInputPin where T: v2::OutputPin, @@ -126,7 +124,6 @@ where } -#[cfg(feature = "unproven")] impl From for OldInputPin where T: v2::InputPin, @@ -139,7 +136,6 @@ where /// Implementation of `v1::InputPin` trait for `v2::InputPin` fallible pins /// where errors will panic. -#[cfg(feature = "unproven")] #[allow(deprecated)] impl v1::InputPin for OldInputPin where @@ -224,15 +220,12 @@ mod tests { o.set_high(); } - #[cfg(feature = "unproven")] use crate::digital::v1::InputPin; - #[cfg(feature = "unproven")] struct NewInputPinImpl { state: Result, } - #[cfg(feature = "unproven")] impl v2::InputPin for NewInputPinImpl { type Error = (); @@ -244,13 +237,11 @@ mod tests { } } - #[cfg(feature = "unproven")] #[allow(deprecated)] struct OldInputPinConsumer { _pin: T, } - #[cfg(feature = "unproven")] #[allow(deprecated)] impl OldInputPinConsumer where T: v1::InputPin @@ -260,14 +251,12 @@ mod tests { } } - #[cfg(feature = "unproven")] #[test] fn v1_v2_input_explicit() { let i = NewInputPinImpl{state: Ok(false)}; let _c: OldInputPinConsumer> = OldInputPinConsumer::new(i.into()); } - #[cfg(feature = "unproven")] #[test] fn v1_v2_input_state() { let i: OldInputPin<_> = NewInputPinImpl{state: Ok(false)}.into(); @@ -276,7 +265,6 @@ mod tests { assert_eq!(i.is_high(), false); } - #[cfg(feature = "unproven")] #[test] #[should_panic] fn v1_v2_input_panic() { diff --git a/src/digital/v2.rs b/src/digital/v2.rs index d8f3cb35e..b8ccf2740 100644 --- a/src/digital/v2.rs +++ b/src/digital/v2.rs @@ -124,9 +124,6 @@ pub mod toggleable { } /// Single digital input pin -/// -/// *This trait is available if embedded-hal is built with the `"unproven"` feature.* -#[cfg(feature = "unproven")] pub trait InputPin { /// Error type type Error; diff --git a/src/digital/v2_compat.rs b/src/digital/v2_compat.rs index 8531d68d7..3ead76027 100644 --- a/src/digital/v2_compat.rs +++ b/src/digital/v2_compat.rs @@ -76,7 +76,6 @@ where impl v2::toggleable::Default for T where T: v1::toggleable::Default {} /// Implementation of fallible `v2::InputPin` for `v1::InputPin` digital traits -#[cfg(feature = "unproven")] #[allow(deprecated)] impl v2::InputPin for T where @@ -176,13 +175,11 @@ mod tests { assert_eq!(o.state, false); } - #[cfg(feature = "unproven")] #[allow(deprecated)] struct OldInputPinImpl { state: bool } - #[cfg(feature = "unproven")] #[allow(deprecated)] impl v1::InputPin for OldInputPinImpl { fn is_low(&self) -> bool { @@ -193,12 +190,10 @@ mod tests { } } - #[cfg(feature = "unproven")] struct NewInputPinConsumer { _pin: T, } - #[cfg(feature = "unproven")] impl NewInputPinConsumer where T: v2::InputPin { pub fn new(pin: T) -> NewInputPinConsumer { @@ -206,14 +201,12 @@ mod tests { } } - #[cfg(feature = "unproven")] #[test] fn v2_v1_input_implicit() { let i = OldInputPinImpl{state: false}; let _c = NewInputPinConsumer::new(i); } - #[cfg(feature = "unproven")] #[test] fn v2_v1_input_state() { let mut i = OldInputPinImpl{state: false}; @@ -221,4 +214,4 @@ mod tests { assert_eq!(v2::InputPin::is_high(&mut i).unwrap(), false); assert_eq!(v2::InputPin::is_low(&mut i).unwrap(), true); } -} \ No newline at end of file +}