From f17bb0d18f3855400623c13e7d0de5b2a5873d5b Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 17 Aug 2023 13:06:05 +1000 Subject: [PATCH] Remove unnecessary reference `T` is a generic that implements`AsRef`, it should not be a reference. This is inline with other usages of `AsRef` for example in `Builder::push_slice`. --- bitcoin/src/blockdata/script/owned.rs | 2 +- bitcoin/src/blockdata/script/tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/src/blockdata/script/owned.rs b/bitcoin/src/blockdata/script/owned.rs index b867e97f..3c9c9f47 100644 --- a/bitcoin/src/blockdata/script/owned.rs +++ b/bitcoin/src/blockdata/script/owned.rs @@ -153,7 +153,7 @@ impl ScriptBuf { } /// Generates OP_RETURN-type of scriptPubkey for the given data. - pub fn new_op_return>(data: &T) -> Self { + pub fn new_op_return>(data: T) -> Self { Builder::new().push_opcode(OP_RETURN).push_slice(data).into_script() } diff --git a/bitcoin/src/blockdata/script/tests.rs b/bitcoin/src/blockdata/script/tests.rs index 4b494a46..610a0e76 100644 --- a/bitcoin/src/blockdata/script/tests.rs +++ b/bitcoin/src/blockdata/script/tests.rs @@ -224,7 +224,7 @@ fn script_generators() { // Test data are taken from the second output of // 2ccb3a1f745eb4eefcf29391460250adda5fab78aaddb902d25d3cd97d9d8e61 transaction let data = hex!("aa21a9ed20280f53f2d21663cac89e6bd2ad19edbabb048cda08e73ed19e9268d0afea2a"); - let op_return = ScriptBuf::new_op_return(&data); + let op_return = ScriptBuf::new_op_return(data); assert!(op_return.is_op_return()); assert_eq!( op_return.to_hex_string(),