diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index d54ccd564..d53eccf58 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -311,17 +311,6 @@ mod tests { 0x15, 0x26, 0x37, 0x48, 0x59, 0x6a, 0x7b, 0x8c, ]); - #[test] - fn convert_newtypes() { - let h1 = DUMMY; - let h2: TestNewtype2 = h1.to_raw_hash().into(); - assert_eq!(&h1[..], &h2[..]); - - let h = sha256d::Hash::hash(&[]); - let h2: TestNewtype = h.to_string().parse().unwrap(); - assert_eq!(h2.to_raw_hash(), h); - } - #[test] fn newtype_fmt_roundtrip() { let orig = DUMMY; diff --git a/hashes/src/util.rs b/hashes/src/util.rs index 746828b7c..eafea64cf 100644 --- a/hashes/src/util.rs +++ b/hashes/src/util.rs @@ -194,21 +194,6 @@ macro_rules! hash_newtype { #[allow(unused)] // Private wrapper types may not need all functions. impl $newtype { - /// Creates this wrapper type from the inner hash type. - pub const fn from_raw_hash(inner: $hash) -> $newtype { - $newtype(inner) - } - - /// Returns the inner hash (sha256, sh256d etc.). - pub const fn to_raw_hash(self) -> $hash { - self.0 - } - - /// Returns a reference to the inner hash (sha256, sh256d etc.). - pub const fn as_raw_hash(&self) -> &$hash { - &self.0 - } - /// Copies a byte slice into a hash object. pub fn from_slice(sl: &[u8]) -> $crate::_export::_core::result::Result<$newtype, $crate::FromSliceError> { Ok($newtype(<$hash as $crate::Hash>::from_slice(sl)?))