Skip to content

Commit 9c57966

Browse files
committed
Merge rust-bitcoin#4954: chore: remove redundant .to_string() call in embedded example
fe9179c chore: remove redundant .to_string() call in embedded example (Bugar) Pull request description: Remove unnecessary .to_string() call on string literal in assert_eq! macro. The assert_eq! macro can compare String and &str directly through PartialEq<&str> for String, making the .to_string() call redundant and creating an unnecessary allocation ACKs for top commit: apoelstra: ACK fe9179c; successfully ran local tests Tree-SHA512: d098c389f7ec1cb5d1b09a5c9d24f09899a90a3469a77f07ceb24993770c1eedb518a9f5bcac0037860a7b7d31b9fa43d72f79d30c4e6516cbfe09f2674e8ab4
2 parents 567b50a + fe9179c commit 9c57966

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bitcoin/embedded/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn main() -> ! {
4646
let address = Address::p2wpkh(pubkey, Network::Bitcoin);
4747
hprintln!("Address: {}", address).unwrap();
4848

49-
assert_eq!(address.to_string(), "bc1qpx9t9pzzl4qsydmhyt6ctrxxjd4ep549np9993".to_string());
49+
assert_eq!(address.to_string(), "bc1qpx9t9pzzl4qsydmhyt6ctrxxjd4ep549np9993");
5050
// exit QEMU
5151
// NOTE do not run this on hardware; it can corrupt OpenOCD state
5252
debug::exit(debug::EXIT_SUCCESS);

0 commit comments

Comments
 (0)