units: Set TBD in deprecate attribute
What changed, and why it matters
This commit only fills in placeholder version numbers in deprecation warnings. It does not change any program behavior, fix any bug, or introduce any security issue. It is a routine documentation/metadata cleanup.
No action required; this is a non-security metadata change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit replaces the placeholder string “TBD” with actual version numbers (mostly “1.0.0-rc.0”, with two items in weight.rs using “1.0.0-rc.1”) in #[deprecated(since = …)] attributes across the units crate. The deprecated items remain present and functionally unchanged; only the metadata string is updated. There is no code logic change.
Changed components
units/src/amount/signed.rsunits/src/fee_rate/mod.rsunits/src/lib.rsunits/src/locktime/absolute/mod.rsunits/src/locktime/relative/mod.rsunits/src/sequence.rsunits/src/weight.rsInspect captured patch +21 / −21
diff --git a/units/src/amount/signed.rs b/units/src/amount/signed.rs
index 9377d1e8..92737216 100644
--- a/units/src/amount/signed.rs
+++ b/units/src/amount/signed.rs
@@ -360,7 +360,7 @@ impl SignedAmount {
///
/// Returns [`None`] if overflow occurred. (`self == i64::MIN`)
#[must_use]
- #[deprecated(since = "TBD", note = "Never returns none, use `abs()` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "Never returns none, use `abs()` instead")]
#[allow(clippy::unnecessary_wraps)] // To match stdlib function definition.
pub const fn checked_abs(self) -> Option<Self> { Some(self.abs()) }
diff --git a/units/src/fee_rate/mod.rs b/units/src/fee_rate/mod.rs
index e94e4973..3e1330bb 100644
--- a/units/src/fee_rate/mod.rs
+++ b/units/src/fee_rate/mod.rs
@@ -190,7 +190,7 @@ impl FeeRate {
///
/// This is equivalent to `Self::mul_by_weight(weight).ok()`.
#[must_use]
- #[deprecated(since = "TBD", note = "use `to_fee()` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `to_fee()` instead")]
pub fn fee_wu(self, weight: Weight) -> Option<Amount> { self.mul_by_weight(weight).ok() }
/// Calculates the fee by multiplying this fee rate by weight, in virtual bytes, returning [`None`]
@@ -199,7 +199,7 @@ impl FeeRate {
/// This is equivalent to converting `vb` to [`Weight`] using [`Weight::from_vb`] and then calling
/// [`Self::to_fee`].
#[must_use]
- #[deprecated(since = "TBD", note = "use Weight::from_vb and then `to_fee()` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use Weight::from_vb and then `to_fee()` instead")]
pub fn fee_vb(self, vb: u64) -> Option<Amount> { Weight::from_vb(vb).map(|w| self.to_fee(w)) }
/// Checked weight multiplication.
diff --git a/units/src/lib.rs b/units/src/lib.rs
index b09d5b78..8c27b593 100644
--- a/units/src/lib.rs
+++ b/units/src/lib.rs
@@ -66,6 +66,6 @@ pub use self::{
weight::Weight
};
-#[deprecated(since = "TBD", note = "use `BlockHeightInterval` instead")]
+#[deprecated(since = "1.0.0-rc.0", note = "use `BlockHeightInterval` instead")]
#[doc(hidden)]
pub type BlockInterval = BlockHeightInterval;
diff --git a/units/src/locktime/absolute/mod.rs b/units/src/locktime/absolute/mod.rs
index 3400d586..fd9b88dd 100644
--- a/units/src/locktime/absolute/mod.rs
+++ b/units/src/locktime/absolute/mod.rs
@@ -208,7 +208,7 @@ impl LockTime {
}
#[inline]
- #[deprecated(since = "TBD", note = "use `from_mtp` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `from_mtp` instead")]
#[doc(hidden)]
pub fn from_time(n: u32) -> Result<Self, ConversionError> { Self::from_mtp(n) }
@@ -543,11 +543,11 @@ impl Height {
/// If the input string is not a valid hex representation of a block height.
pub fn from_hex(s: &str) -> Result<Self, ParseHeightError> { parse_hex(s, Self::from_u32) }
- #[deprecated(since = "TBD", note = "use `from_u32` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `from_u32` instead")]
#[doc(hidden)]
pub const fn from_consensus(n: u32) -> Result<Self, ConversionError> { Self::from_u32(n) }
- #[deprecated(since = "TBD", note = "use `to_u32` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `to_u32` instead")]
#[doc(hidden)]
pub const fn to_consensus_u32(self) -> u32 { self.to_u32() }
@@ -607,7 +607,7 @@ impl fmt::Display for Height {
parse_int::impl_parse_str!(Height, ParseHeightError, parser(Height::from_u32));
-#[deprecated(since = "TBD", note = "use `MedianTimePast` instead")]
+#[deprecated(since = "1.0.0-rc.0", note = "use `MedianTimePast` instead")]
#[doc(hidden)]
pub type Time = MedianTimePast;
@@ -655,11 +655,11 @@ impl MedianTimePast {
/// If the input string is not a valid hex representation of a block time.
pub fn from_hex(s: &str) -> Result<Self, ParseTimeError> { parse_hex(s, Self::from_u32) }
- #[deprecated(since = "TBD", note = "use `from_u32` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `from_u32` instead")]
#[doc(hidden)]
pub const fn from_consensus(n: u32) -> Result<Self, ConversionError> { Self::from_u32(n) }
- #[deprecated(since = "TBD", note = "use `to_u32` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `to_u32` instead")]
#[doc(hidden)]
pub const fn to_consensus_u32(self) -> u32 { self.to_u32() }
diff --git a/units/src/locktime/relative/mod.rs b/units/src/locktime/relative/mod.rs
index 59667b02..94523938 100644
--- a/units/src/locktime/relative/mod.rs
+++ b/units/src/locktime/relative/mod.rs
@@ -400,7 +400,7 @@ impl<'de> serde::Deserialize<'de> for LockTime {
}
}
-#[deprecated(since = "TBD", note = "use `NumberOfBlocks` instead")]
+#[deprecated(since = "1.0.0-rc.0", note = "use `NumberOfBlocks` instead")]
#[doc(hidden)]
pub type Height = NumberOfBlocks;
@@ -430,14 +430,14 @@ impl NumberOfBlocks {
/// Returns the inner `u16` value.
#[inline]
#[must_use]
- #[deprecated(since = "TBD", note = "use `to_height` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `to_height` instead")]
#[doc(hidden)]
pub const fn value(self) -> u16 { self.0 }
/// Returns the `u32` value used to encode this locktime in an nSequence field or
/// argument to `OP_CHECKSEQUENCEVERIFY`.
#[deprecated(
- since = "TBD",
+ since = "1.0.0-rc.0",
note = "use `LockTime::from` followed by `to_consensus_u32` instead"
)]
pub const fn to_consensus_u32(self) -> u32 {
@@ -479,7 +479,7 @@ impl fmt::Display for NumberOfBlocks {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::Display::fmt(&self.0, f) }
}
-#[deprecated(since = "TBD", note = "use `NumberOf512Seconds` instead")]
+#[deprecated(since = "1.0.0-rc.0", note = "use `NumberOf512Seconds` instead")]
#[doc(hidden)]
pub type Time = NumberOf512Seconds;
@@ -552,14 +552,14 @@ impl NumberOf512Seconds {
/// Returns the inner `u16` value.
#[inline]
#[must_use]
- #[deprecated(since = "TBD", note = "use `to_512_second_intervals` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `to_512_second_intervals` instead")]
#[doc(hidden)]
pub const fn value(self) -> u16 { self.0 }
/// Returns the `u32` value used to encode this locktime in an nSequence field or
/// argument to `OP_CHECKSEQUENCEVERIFY`.
#[deprecated(
- since = "TBD",
+ since = "1.0.0-rc.0",
note = "use `LockTime::from` followed by `to_consensus_u32` instead"
)]
pub const fn to_consensus_u32(self) -> u32 {
diff --git a/units/src/sequence.rs b/units/src/sequence.rs
index b165eef5..3910195a 100644
--- a/units/src/sequence.rs
+++ b/units/src/sequence.rs
@@ -50,7 +50,7 @@ impl Sequence {
pub const ENABLE_LOCKTIME_NO_RBF: Self = Self::MIN_NO_RBF;
/// The sequence number that enables replace-by-fee and absolute lock time but
/// disables relative lock time.
- #[deprecated(since = "TBD", note = "use `ENABLE_LOCKTIME_AND_RBF` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `ENABLE_LOCKTIME_AND_RBF` instead")]
pub const ENABLE_RBF_NO_LOCKTIME: Self = Self(0xFFFF_FFFD);
/// The maximum sequence number that enables replace-by-fee and absolute lock time but
/// disables relative lock time.
@@ -203,7 +203,7 @@ impl Sequence {
/// Gets the hex representation of this [`Sequence`].
#[cfg(feature = "alloc")]
#[inline]
- #[deprecated(since = "TBD", note = "use `format!(\"{var:x}\")` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `format!(\"{var:x}\")` instead")]
pub fn to_hex(self) -> alloc::string::String { alloc::format!("{:x}", self) }
/// Constructs a new [`relative::LockTime`] from this [`Sequence`] number.
diff --git a/units/src/weight.rs b/units/src/weight.rs
index 0a3a2d90..e701a669 100644
--- a/units/src/weight.rs
+++ b/units/src/weight.rs
@@ -82,7 +82,7 @@ impl Weight {
/// # Panics
///
/// If the conversion from virtual bytes overflows.
- #[deprecated(since = "TBD", note = "use `from_vb_unchecked` instead")]
+ #[deprecated(since = "1.0.0-rc.0", note = "use `from_vb_unchecked` instead")]
pub const fn from_vb_unwrap(vb: u64) -> Self {
match vb.checked_mul(Self::WITNESS_SCALE_FACTOR) {
Some(weight) => Self::from_wu(weight),
@@ -96,7 +96,7 @@ impl Weight {
}
/// Constructs a new [`Weight`] from witness size.
- #[deprecated(since = "TBD", note = "use `from_wu` instead")]
+ #[deprecated(since = "1.0.0-rc.1", note = "use `from_wu` instead")]
pub const fn from_witness_data_size(witness_size: u64) -> Self { Self::from_wu(witness_size) }
/// Constructs a new [`Weight`] from non-witness size.
@@ -104,7 +104,7 @@ impl Weight {
/// # Panics
///
/// If the conversion from virtual bytes overflows.
- #[deprecated(since = "TBD", note = "use `from_vb` or `from_vb_unchecked` instead")]
+ #[deprecated(since = "1.0.0-rc.1", note = "use `from_vb` or `from_vb_unchecked` instead")]
pub const fn from_non_witness_data_size(non_witness_size: u64) -> Self {
Self::from_wu(non_witness_size * Self::WITNESS_SCALE_FACTOR)
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.