Skip to content

Commit 421d11b

Browse files
committed
Add deprecation version and note
1 parent d7be300 commit 421d11b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/digital/mod.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
///
88
/// *This version of the trait is now deprecated. Please use the new `OutputPin` trait in
99
/// `digital::v2::OutputPin`*.
10-
#[deprecated]
10+
#[deprecated(since = "0.2.2", note = "Deprecated because the methods cannot return errors. \
11+
Users should use the traits in digital::v2.")]
1112
pub trait OutputPin {
1213
/// Drives the pin low
1314
///
@@ -28,7 +29,8 @@ pub trait OutputPin {
2829
///
2930
/// *This version of the trait is now deprecated. Please use the new `StatefulOutputPin` trait in
3031
/// `digital::v2::StatefulOutputPin`*.
31-
#[deprecated]
32+
#[deprecated(since = "0.2.2", note = "Deprecated because the methods cannot return errors. \
33+
Users should use the traits in digital::v2.")]
3234
#[cfg(feature = "unproven")]
3335
pub trait StatefulOutputPin {
3436
/// Is the pin in drive high mode?
@@ -53,7 +55,8 @@ pub trait StatefulOutputPin {
5355
/// both [OutputPin](trait.OutputPin.html) and
5456
/// [StatefulOutputPin](trait.StatefulOutputPin.html) are
5557
/// implemented. Otherwise, implement this using hardware mechanisms.
56-
#[deprecated]
58+
#[deprecated(since = "0.2.2", note = "Deprecated because the methods cannot return errors. \
59+
Users should use the traits in digital::v2.")]
5760
#[cfg(feature = "unproven")]
5861
pub trait ToggleableOutputPin {
5962
/// Toggle pin output.
@@ -102,7 +105,8 @@ pub trait ToggleableOutputPin {
102105
/// pin.toggle();
103106
/// assert!(pin.is_set_low());
104107
/// ```
105-
#[deprecated]
108+
#[deprecated(since = "0.2.2", note = "Deprecated because the methods cannot return errors. \
109+
Users should use the traits in digital::v2.")]
106110
#[cfg(feature = "unproven")]
107111
pub mod toggleable {
108112
#[allow(deprecated)]
@@ -136,7 +140,8 @@ pub mod toggleable {
136140
///
137141
/// *This version of the trait is now deprecated. Please use the new `InputPin` trait in
138142
/// `digital::v2::InputPin`*.
139-
#[deprecated]
143+
#[deprecated(since = "0.2.2", note = "Deprecated because the methods cannot return errors. \
144+
Users should use the traits in digital::v2.")]
140145
#[cfg(feature = "unproven")]
141146
pub trait InputPin {
142147
/// Is the input pin high?

0 commit comments

Comments
 (0)