From 9b81a8a2ed1c4f138c592468979e927aa1178830 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 27 Jan 2025 10:36:39 +1100 Subject: [PATCH 1/2] hashes: Remove sha256t::Hash Default impl The other hash types do not implement `Default` but the tagged one does still - bad bitcoin devs, no biscuit. --- hashes/src/sha256t.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/hashes/src/sha256t.rs b/hashes/src/sha256t.rs index cb3f4aaaa..6c62846c8 100644 --- a/hashes/src/sha256t.rs +++ b/hashes/src/sha256t.rs @@ -119,9 +119,6 @@ impl PartialEq for Hash { fn eq(&self, other: &Hash) -> bool { self.0 == other.0 } } impl Eq for Hash {} -impl Default for Hash { - fn default() -> Self { Hash([0; 32], PhantomData) } -} impl PartialOrd for Hash { fn partial_cmp(&self, other: &Hash) -> Option { Some(cmp::Ord::cmp(self, other)) From 513402518016bde0d55ec66f8be573bd3e6209ee Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 29 Jan 2025 12:28:24 +1100 Subject: [PATCH 2/2] api: Run just check-api --- api/hashes/all-features.txt | 2 -- api/hashes/alloc-only.txt | 2 -- api/hashes/no-features.txt | 2 -- 3 files changed, 6 deletions(-) diff --git a/api/hashes/all-features.txt b/api/hashes/all-features.txt index 6a776f228..afc1cf84f 100644 --- a/api/hashes/all-features.txt +++ b/api/hashes/all-features.txt @@ -475,7 +475,6 @@ impl core::cmp::PartialEq for bitcoin_hashes::s impl core::cmp::PartialOrd for bitcoin_hashes::sha256t::Hash impl core::convert::AsRef<[u8; 32]> for bitcoin_hashes::sha256t::Hash impl core::convert::AsRef<[u8]> for bitcoin_hashes::sha256t::Hash -impl core::default::Default for bitcoin_hashes::sha256t::Hash impl core::fmt::Debug for bitcoin_hashes::sha256t::Hash impl core::fmt::Display for bitcoin_hashes::sha256t::Hash impl core::fmt::LowerHex for bitcoin_hashes::sha256t::Hash @@ -845,7 +844,6 @@ pub fn bitcoin_hashes::sha256t::Hash::borrow(&self) -> &[u8; 32] pub fn bitcoin_hashes::sha256t::Hash::borrow(&self) -> &[u8] pub fn bitcoin_hashes::sha256t::Hash::clone(&self) -> Self pub fn bitcoin_hashes::sha256t::Hash::cmp(&self, other: &bitcoin_hashes::sha256t::Hash) -> core::cmp::Ordering -pub fn bitcoin_hashes::sha256t::Hash::default() -> Self pub fn bitcoin_hashes::sha256t::Hash::deserialize>(d: D) -> core::result::Result, ::Error> pub fn bitcoin_hashes::sha256t::Hash::engine() -> bitcoin_hashes::sha256::HashEngine pub fn bitcoin_hashes::sha256t::Hash::eq(&self, other: &bitcoin_hashes::sha256t::Hash) -> bool diff --git a/api/hashes/alloc-only.txt b/api/hashes/alloc-only.txt index 35bf80f4d..36736de91 100644 --- a/api/hashes/alloc-only.txt +++ b/api/hashes/alloc-only.txt @@ -431,7 +431,6 @@ impl core::cmp::PartialEq for bitcoin_hashes::s impl core::cmp::PartialOrd for bitcoin_hashes::sha256t::Hash impl core::convert::AsRef<[u8; 32]> for bitcoin_hashes::sha256t::Hash impl core::convert::AsRef<[u8]> for bitcoin_hashes::sha256t::Hash -impl core::default::Default for bitcoin_hashes::sha256t::Hash impl core::fmt::Debug for bitcoin_hashes::sha256t::Hash impl core::fmt::Display for bitcoin_hashes::sha256t::Hash impl core::fmt::LowerHex for bitcoin_hashes::sha256t::Hash @@ -734,7 +733,6 @@ pub fn bitcoin_hashes::sha256t::Hash::borrow(&self) -> &[u8; 32] pub fn bitcoin_hashes::sha256t::Hash::borrow(&self) -> &[u8] pub fn bitcoin_hashes::sha256t::Hash::clone(&self) -> Self pub fn bitcoin_hashes::sha256t::Hash::cmp(&self, other: &bitcoin_hashes::sha256t::Hash) -> core::cmp::Ordering -pub fn bitcoin_hashes::sha256t::Hash::default() -> Self pub fn bitcoin_hashes::sha256t::Hash::engine() -> bitcoin_hashes::sha256::HashEngine pub fn bitcoin_hashes::sha256t::Hash::eq(&self, other: &bitcoin_hashes::sha256t::Hash) -> bool pub fn bitcoin_hashes::sha256t::Hash::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result diff --git a/api/hashes/no-features.txt b/api/hashes/no-features.txt index cd19b4663..c72566385 100644 --- a/api/hashes/no-features.txt +++ b/api/hashes/no-features.txt @@ -395,7 +395,6 @@ impl core::cmp::PartialEq for bitcoin_hashes::s impl core::cmp::PartialOrd for bitcoin_hashes::sha256t::Hash impl core::convert::AsRef<[u8; 32]> for bitcoin_hashes::sha256t::Hash impl core::convert::AsRef<[u8]> for bitcoin_hashes::sha256t::Hash -impl core::default::Default for bitcoin_hashes::sha256t::Hash impl core::fmt::Debug for bitcoin_hashes::sha256t::Hash impl core::hash::Hash for bitcoin_hashes::sha256t::Hash impl core::marker::Copy for bitcoin_hashes::sha256t::Hash @@ -687,7 +686,6 @@ pub fn bitcoin_hashes::sha256t::Hash::borrow(&self) -> &[u8; 32] pub fn bitcoin_hashes::sha256t::Hash::borrow(&self) -> &[u8] pub fn bitcoin_hashes::sha256t::Hash::clone(&self) -> Self pub fn bitcoin_hashes::sha256t::Hash::cmp(&self, other: &bitcoin_hashes::sha256t::Hash) -> core::cmp::Ordering -pub fn bitcoin_hashes::sha256t::Hash::default() -> Self pub fn bitcoin_hashes::sha256t::Hash::engine() -> bitcoin_hashes::sha256::HashEngine pub fn bitcoin_hashes::sha256t::Hash::eq(&self, other: &bitcoin_hashes::sha256t::Hash) -> bool pub fn bitcoin_hashes::sha256t::Hash::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result