From 5b572c5976a51613c96ff4dcc70ec3feae710b64 Mon Sep 17 00:00:00 2001 From: aagbotemi Date: Tue, 22 Apr 2025 04:28:51 +0100 Subject: [PATCH 1/2] docs(witness): use constructs instead of creates --- primitives/src/witness.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/src/witness.rs b/primitives/src/witness.rs index bbbc05376..98e348b3d 100644 --- a/primitives/src/witness.rs +++ b/primitives/src/witness.rs @@ -221,7 +221,7 @@ impl Witness { Some(&slice[..end]) } - /// Creates a new witness from a list of hex strings. + /// Constructs a new witness from a list of hex strings. /// /// # Errors /// From 9eaaf114b0d6afb810cec8e9dac603ecadf64ff4 Mon Sep 17 00:00:00 2001 From: aagbotemi Date: Tue, 22 Apr 2025 04:55:48 +0100 Subject: [PATCH 2/2] fix(witness): remove explicit type --- primitives/src/witness.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/primitives/src/witness.rs b/primitives/src/witness.rs index 98e348b3d..28a348704 100644 --- a/primitives/src/witness.rs +++ b/primitives/src/witness.rs @@ -232,7 +232,11 @@ impl Witness { I: IntoIterator, T: AsRef, { - let result: Vec> = iter.into_iter().map(|hex_str| Vec::from_hex(hex_str.as_ref())).collect::, _>>()?; + let result = iter + .into_iter() + .map(|hex_str| Vec::from_hex(hex_str.as_ref())) + .collect::, _>>()?; + Ok(Self::from_slice(&result)) } }