diff --git a/bitcoin/src/amount.rs b/bitcoin/src/amount.rs index aa008b44..0e9135b8 100644 --- a/bitcoin/src/amount.rs +++ b/bitcoin/src/amount.rs @@ -2361,8 +2361,7 @@ mod tests { #[test] fn disallow_confusing_forms() { - let confusing = - vec!["Msat", "Msats", "MSAT", "MSATS", "MSat", "MSats", "MBTC", "Mbtc", "PBTC"]; + let confusing = ["Msat", "Msats", "MSAT", "MSATS", "MSat", "MSats", "MBTC", "Mbtc", "PBTC"]; for denom in confusing.iter() { match Denomination::from_str(denom) { Ok(_) => panic!("from_str should error for {}", denom), @@ -2375,7 +2374,7 @@ mod tests { #[test] fn disallow_unknown_denomination() { // Non-exhaustive list of unknown forms. - let unknown = vec!["NBTC", "UBTC", "ABC", "abc", "cBtC", "Sat", "Sats"]; + let unknown = ["NBTC", "UBTC", "ABC", "abc", "cBtC", "Sat", "Sats"]; for denom in unknown.iter() { match Denomination::from_str(denom) { Ok(_) => panic!("from_str should error for {}", denom), diff --git a/bitcoin/src/bip158.rs b/bitcoin/src/bip158.rs index 603fae65..97a4b222 100644 --- a/bitcoin/src/bip158.rs +++ b/bitcoin/src/bip158.rs @@ -616,7 +616,7 @@ mod test { .unwrap()); for script in txmap.values() { - let query = vec![script]; + let query = [script]; if !script.is_empty() { assert!(filter .match_any(block_hash, &mut query.iter().map(|s| s.as_bytes())) diff --git a/bitcoin/src/merkle_tree/block.rs b/bitcoin/src/merkle_tree/block.rs index 076e55dc..95d51bdd 100644 --- a/bitcoin/src/merkle_tree/block.rs +++ b/bitcoin/src/merkle_tree/block.rs @@ -700,7 +700,7 @@ mod tests { let txid1 = txids[0]; let txid2 = txids[1]; - let txids = vec![txid1, txid2]; + let txids = [txid1, txid2]; let merkle_block = MerkleBlock::from_block_with_predicate(&block, |t| txids.contains(t)); diff --git a/hashes/src/sha256t.rs b/hashes/src/sha256t.rs index 6b94dfc8..6b4847a9 100644 --- a/hashes/src/sha256t.rs +++ b/hashes/src/sha256t.rs @@ -39,7 +39,7 @@ impl Hash { impl Copy for Hash {} impl Clone for Hash { - fn clone(&self) -> Self { Hash(self.0, self.1) } + fn clone(&self) -> Self { *self } } impl PartialEq for Hash { fn eq(&self, other: &Hash) -> bool { self.0 == other.0 }