Replace TBD with next hashes release version
We are about to release `bitcoin_hashes 0.15.0`, replace the TBD string with the version number. Requires changing `allow(deprecated_in_future)` attribute to `allow(deprecated)` (in functions that are them self deprecated).
This commit is contained in:
parent
baab5e580d
commit
2868985a91
|
@ -129,7 +129,7 @@ impl<T: GeneralHash> Hash for Hmac<T> {
|
||||||
|
|
||||||
fn from_byte_array(bytes: T::Bytes) -> Self { Hmac(T::from_byte_array(bytes)) }
|
fn from_byte_array(bytes: T::Bytes) -> Self { Hmac(T::from_byte_array(bytes)) }
|
||||||
|
|
||||||
#[allow(deprecated_in_future)]
|
#[allow(deprecated)]
|
||||||
fn from_slice(sl: &[u8]) -> Result<Hmac<T>, FromSliceError> { T::from_slice(sl).map(Hmac) }
|
fn from_slice(sl: &[u8]) -> Result<Hmac<T>, FromSliceError> { T::from_slice(sl).map(Hmac) }
|
||||||
|
|
||||||
fn to_byte_array(self) -> Self::Bytes { self.0.to_byte_array() }
|
fn to_byte_array(self) -> Self::Bytes { self.0.to_byte_array() }
|
||||||
|
|
|
@ -99,7 +99,7 @@ macro_rules! hash_trait_impls {
|
||||||
|
|
||||||
fn from_byte_array(bytes: Self::Bytes) -> Self { Self::from_byte_array(bytes) }
|
fn from_byte_array(bytes: Self::Bytes) -> Self { Self::from_byte_array(bytes) }
|
||||||
|
|
||||||
#[allow(deprecated_in_future)]
|
#[allow(deprecated)]
|
||||||
fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<Hash<$($gen),*>, $crate::FromSliceError> {
|
fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<Hash<$($gen),*>, $crate::FromSliceError> {
|
||||||
Self::from_slice(sl)
|
Self::from_slice(sl)
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ pub mod sha512;
|
||||||
pub mod sha512_256;
|
pub mod sha512_256;
|
||||||
pub mod siphash24;
|
pub mod siphash24;
|
||||||
|
|
||||||
#[deprecated(since = "TBD", note = "use crate::macros instead")]
|
#[deprecated(since = "0.15.0", note = "use crate::macros instead")]
|
||||||
pub mod serde_macros {
|
pub mod serde_macros {
|
||||||
//! Macros for serde trait implementations, and supporting code.
|
//! Macros for serde trait implementations, and supporting code.
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ pub trait Hash:
|
||||||
fn from_byte_array(bytes: Self::Bytes) -> Self;
|
fn from_byte_array(bytes: Self::Bytes) -> Self;
|
||||||
|
|
||||||
/// Copies a byte slice into a hash object.
|
/// Copies a byte slice into a hash object.
|
||||||
#[deprecated(since = "TBD", note = "use `from_byte_array` instead")]
|
#[deprecated(since = "0.15.0", note = "use `from_byte_array` instead")]
|
||||||
fn from_slice(sl: &[u8]) -> Result<Self, FromSliceError>;
|
fn from_slice(sl: &[u8]) -> Result<Self, FromSliceError>;
|
||||||
|
|
||||||
/// Returns the underlying byte array.
|
/// Returns the underlying byte array.
|
||||||
|
|
|
@ -175,8 +175,8 @@ macro_rules! hash_newtype {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Copies a byte slice into a hash object.
|
/// Copies a byte slice into a hash object.
|
||||||
#[deprecated(since = "TBD", note = "use `from_byte_array` instead")]
|
#[deprecated(since = "0.15.0", note = "use `from_byte_array` instead")]
|
||||||
#[allow(deprecated_in_future)]
|
#[allow(deprecated)]
|
||||||
pub fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<$newtype, $crate::FromSliceError> {
|
pub fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<$newtype, $crate::FromSliceError> {
|
||||||
Ok($newtype(<$hash as $crate::Hash>::from_slice(sl)?))
|
Ok($newtype(<$hash as $crate::Hash>::from_slice(sl)?))
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ macro_rules! hash_newtype {
|
||||||
fn from_byte_array(bytes: Self::Bytes) -> Self { Self::from_byte_array(bytes) }
|
fn from_byte_array(bytes: Self::Bytes) -> Self { Self::from_byte_array(bytes) }
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[allow(deprecated_in_future)]
|
#[allow(deprecated)]
|
||||||
fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<$newtype, $crate::FromSliceError> {
|
fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<$newtype, $crate::FromSliceError> {
|
||||||
Self::from_slice(sl)
|
Self::from_slice(sl)
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ impl Hash {
|
||||||
/// Computes hash from `bytes` in `const` context.
|
/// Computes hash from `bytes` in `const` context.
|
||||||
///
|
///
|
||||||
/// Warning: this function is inefficient. It should be only used in `const` context.
|
/// Warning: this function is inefficient. It should be only used in `const` context.
|
||||||
#[deprecated(since = "TBD", note = "use `Self::hash_unoptimized` instead")]
|
#[deprecated(since = "0.15.0", note = "use `Self::hash_unoptimized` instead")]
|
||||||
pub const fn const_hash(bytes: &[u8]) -> Self { Hash::hash_unoptimized(bytes) }
|
pub const fn const_hash(bytes: &[u8]) -> Self { Hash::hash_unoptimized(bytes) }
|
||||||
|
|
||||||
/// Computes hash from `bytes` in `const` context.
|
/// Computes hash from `bytes` in `const` context.
|
||||||
|
|
|
@ -43,7 +43,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Copies a byte slice into a hash object.
|
/// Copies a byte slice into a hash object.
|
||||||
#[deprecated(since = "TBD", note = "use `from_byte_array` instead")]
|
#[deprecated(since = "0.15.0", note = "use `from_byte_array` instead")]
|
||||||
pub fn from_slice(sl: &[u8]) -> Result<Hash<T>, FromSliceError> {
|
pub fn from_slice(sl: &[u8]) -> Result<Hash<T>, FromSliceError> {
|
||||||
if sl.len() != 32 {
|
if sl.len() != 32 {
|
||||||
Err(FromSliceError { expected: 32, got: sl.len() })
|
Err(FromSliceError { expected: 32, got: sl.len() })
|
||||||
|
@ -186,6 +186,7 @@ macro_rules! sha256t_tag {
|
||||||
/// The syntax is:
|
/// The syntax is:
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
/// # #[allow(deprecated)] {
|
||||||
/// # use bitcoin_hashes::sha256t_hash_newtype;
|
/// # use bitcoin_hashes::sha256t_hash_newtype;
|
||||||
/// sha256t_hash_newtype! {
|
/// sha256t_hash_newtype! {
|
||||||
/// /// Optional documentation details here.
|
/// /// Optional documentation details here.
|
||||||
|
@ -197,6 +198,7 @@ macro_rules! sha256t_tag {
|
||||||
/// #[hash_newtype(backward)]
|
/// #[hash_newtype(backward)]
|
||||||
/// pub struct FooHash(_);
|
/// pub struct FooHash(_);
|
||||||
/// }
|
/// }
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// The structs must be defined in this order - tag first, then hash type. `hash_str` marker
|
/// The structs must be defined in this order - tag first, then hash type. `hash_str` marker
|
||||||
|
@ -211,7 +213,7 @@ macro_rules! sha256t_tag {
|
||||||
///
|
///
|
||||||
/// [`hash_newtype`]: crate::hash_newtype
|
/// [`hash_newtype`]: crate::hash_newtype
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[deprecated(since = "TBD", note = "use `sha256_tag!` combined with `hash_newtype!` instead")]
|
#[deprecated(since = "0.15.0", note = "use `sha256_tag!` combined with `hash_newtype!` instead")]
|
||||||
macro_rules! sha256t_hash_newtype {
|
macro_rules! sha256t_hash_newtype {
|
||||||
($(#[$($tag_attr:tt)*])* $tag_vis:vis struct $tag:ident = $constructor:tt($($tag_value:tt)+); $(#[$($hash_attr:tt)*])* $hash_vis:vis struct $hash_name:ident($(#[$($field_attr:tt)*])* _);) => {
|
($(#[$($tag_attr:tt)*])* $tag_vis:vis struct $tag:ident = $constructor:tt($($tag_value:tt)+); $(#[$($hash_attr:tt)*])* $hash_vis:vis struct $hash_name:ident($(#[$($field_attr:tt)*])* _);) => {
|
||||||
$crate::sha256t_tag_struct!($tag_vis, $tag, stringify!($hash_name), $(#[$($tag_attr)*])*);
|
$crate::sha256t_tag_struct!($tag_vis, $tag, stringify!($hash_name), $(#[$($tag_attr)*])*);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
// SPDX-License-Identifier: CC0-1.0
|
// SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
//! SipHash 2-4 implementation.
|
//! SipHash 2-4 implementation.
|
||||||
|
@ -203,7 +204,7 @@ impl Hash {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the (little endian) 64-bit integer representation of the hash value.
|
/// Returns the (little endian) 64-bit integer representation of the hash value.
|
||||||
#[deprecated(since = "TBD", note = "use `to_u64` instead")]
|
#[deprecated(since = "0.15.0", note = "use `to_u64` instead")]
|
||||||
pub fn as_u64(&self) -> u64 { self.to_u64() }
|
pub fn as_u64(&self) -> u64 { self.to_u64() }
|
||||||
|
|
||||||
/// Returns the (little endian) 64-bit integer representation of the hash value.
|
/// Returns the (little endian) 64-bit integer representation of the hash value.
|
||||||
|
|
Loading…
Reference in New Issue