Skip to content

Commit 9c377b2

Browse files
committed
Remove useless use of format
Clippy emits: warning: Useless use of format Use string directly.
1 parent bf44938 commit 9c377b2

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

src/descriptor/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,9 @@ mod tests {
10301030

10311031
#[test]
10321032
pub fn script_pubkey() {
1033-
let bare = StdDescriptor::from_str(&format!(
1034-
"multi(1,020000000000000000000000000000000000000000000000000000000000000002)"
1035-
))
1033+
let bare = StdDescriptor::from_str(
1034+
"multi(1,020000000000000000000000000000000000000000000000000000000000000002)",
1035+
)
10361036
.unwrap();
10371037
assert_eq!(
10381038
bare.script_pubkey(),

src/miniscript/mod.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,28 +1003,28 @@ mod tests {
10031003
#[test]
10041004
fn test_tapscript_rtt() {
10051005
// Test x-only invalid under segwitc0 context
1006-
let ms = Segwitv0Script::from_str_insane(&format!(
1007-
"pk(2788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)"
1008-
));
1006+
let ms = Segwitv0Script::from_str_insane(
1007+
"pk(2788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)",
1008+
);
10091009
assert_eq!(
10101010
ms.unwrap_err().to_string(),
10111011
"unexpected «key hex decoding error»",
10121012
);
1013-
Tapscript::from_str_insane(&format!(
1014-
"pk(2788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)"
1015-
))
1013+
Tapscript::from_str_insane(
1014+
"pk(2788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)",
1015+
)
10161016
.unwrap();
10171017

10181018
// Now test that bitcoin::PublicKey works with Taproot context
1019-
Miniscript::<bitcoin::PublicKey, Tap>::from_str_insane(&format!(
1020-
"pk(022788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)"
1021-
))
1019+
Miniscript::<bitcoin::PublicKey, Tap>::from_str_insane(
1020+
"pk(022788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)",
1021+
)
10221022
.unwrap();
10231023

10241024
// uncompressed keys should not be allowed
1025-
Miniscript::<bitcoin::PublicKey, Tap>::from_str_insane(&format!(
1025+
Miniscript::<bitcoin::PublicKey, Tap>::from_str_insane(
10261026
"pk(04eed24a081bf1b1e49e3300df4bebe04208ac7e516b6f3ea8eb6e094584267c13483f89dcf194132e12238cc5a34b6b286fc7990d68ed1db86b69ebd826c63b29)"
1027-
))
1027+
)
10281028
.unwrap_err();
10291029

10301030
//---------------- test script <-> miniscript ---------------
@@ -1050,14 +1050,14 @@ mod tests {
10501050
.unwrap();
10511051

10521052
// multi not allowed in tapscript
1053-
Tapscript::from_str_insane(&format!(
1054-
"multi(1,2788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)"
1055-
))
1053+
Tapscript::from_str_insane(
1054+
"multi(1,2788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)",
1055+
)
10561056
.unwrap_err();
10571057
// but allowed in segwit
1058-
Segwitv0Script::from_str_insane(&format!(
1059-
"multi(1,022788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)"
1060-
))
1058+
Segwitv0Script::from_str_insane(
1059+
"multi(1,022788ee41e76f4f3af603da5bc8fa22997bc0344bb0f95666ba6aaff0242baa99)",
1060+
)
10611061
.unwrap();
10621062
}
10631063

src/psbt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ mod tests {
16671667

16681668
#[test]
16691669
fn test_update_input_checks() {
1670-
let desc = format!("tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/0)");
1670+
let desc = "tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/0)";
16711671
let desc = Descriptor::<DefiniteDescriptorKey>::from_str(&desc).unwrap();
16721672

16731673
let mut non_witness_utxo = bitcoin::Transaction {
@@ -1732,7 +1732,7 @@ mod tests {
17321732

17331733
#[test]
17341734
fn test_update_output_checks() {
1735-
let desc = format!("tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/0)");
1735+
let desc = "tr([73c5da0a/86'/0'/0']xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/0)";
17361736
let desc = Descriptor::<DefiniteDescriptorKey>::from_str(&desc).unwrap();
17371737

17381738
let tx = bitcoin::Transaction {

0 commit comments

Comments
 (0)