From 1af6ff43942758a75acb4d0b6b1e781bf75de1f1 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 9 Aug 2024 12:11:42 +1000 Subject: [PATCH] hashes: Feature gate hash_reader unit test The `hash_reader` function is only available when `bitcoin-io` is enabled - it should be feature gated. --- hashes/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hashes/src/lib.rs b/hashes/src/lib.rs index fb78fdbd7..897f97b8f 100644 --- a/hashes/src/lib.rs +++ b/hashes/src/lib.rs @@ -324,7 +324,7 @@ impl std::error::Error for FromSliceError {} #[cfg(test)] mod tests { use super::*; - use crate::{sha256, sha256d}; + use crate::sha256d; hash_newtype! { /// A test newtype @@ -351,7 +351,10 @@ mod tests { } #[test] + #[cfg(feature = "bitcoin-io")] fn hash_reader() { + use crate::sha256; + let mut reader: &[u8] = b"hello"; assert_eq!(sha256::Hash::hash_reader(&mut reader).unwrap(), sha256::Hash::hash(b"hello"),) }