724be17394 Remove useless usage of vec! macro (Tobin C. Harding)
e84ca292d9 Clear incorrect implementation of clone warning (Tobin C. Harding)

Pull request description:

  A new version `clippy 0.1.72 (5680fa1 2023-08-23)` just came out and we get a two new warnings. Fix them up.

ACKs for top commit:
  apoelstra:
    ACK 724be17394

Tree-SHA512: f82f026773f8738d8d89710b36b979850e0e33c4d1afb4f78d2d4e957b37dd850ef9e83c9e25197dac981c7b49c448e49078777261749567303f1aac282b3d33
This commit is contained in:
Andrew Poelstra 2023-08-25 13:02:41 +00:00
commit bd05e3f309
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
4 changed files with 5 additions and 6 deletions

View File

@ -2361,8 +2361,7 @@ mod tests {
#[test] #[test]
fn disallow_confusing_forms() { fn disallow_confusing_forms() {
let confusing = let confusing = ["Msat", "Msats", "MSAT", "MSATS", "MSat", "MSats", "MBTC", "Mbtc", "PBTC"];
vec!["Msat", "Msats", "MSAT", "MSATS", "MSat", "MSats", "MBTC", "Mbtc", "PBTC"];
for denom in confusing.iter() { for denom in confusing.iter() {
match Denomination::from_str(denom) { match Denomination::from_str(denom) {
Ok(_) => panic!("from_str should error for {}", denom), Ok(_) => panic!("from_str should error for {}", denom),
@ -2375,7 +2374,7 @@ mod tests {
#[test] #[test]
fn disallow_unknown_denomination() { fn disallow_unknown_denomination() {
// Non-exhaustive list of unknown forms. // 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() { for denom in unknown.iter() {
match Denomination::from_str(denom) { match Denomination::from_str(denom) {
Ok(_) => panic!("from_str should error for {}", denom), Ok(_) => panic!("from_str should error for {}", denom),

View File

@ -616,7 +616,7 @@ mod test {
.unwrap()); .unwrap());
for script in txmap.values() { for script in txmap.values() {
let query = vec![script]; let query = [script];
if !script.is_empty() { if !script.is_empty() {
assert!(filter assert!(filter
.match_any(block_hash, &mut query.iter().map(|s| s.as_bytes())) .match_any(block_hash, &mut query.iter().map(|s| s.as_bytes()))

View File

@ -700,7 +700,7 @@ mod tests {
let txid1 = txids[0]; let txid1 = txids[0];
let txid2 = txids[1]; 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)); let merkle_block = MerkleBlock::from_block_with_predicate(&block, |t| txids.contains(t));

View File

@ -39,7 +39,7 @@ impl<T: Tag> Hash<T> {
impl<T: Tag> Copy for Hash<T> {} impl<T: Tag> Copy for Hash<T> {}
impl<T: Tag> Clone for Hash<T> { impl<T: Tag> Clone for Hash<T> {
fn clone(&self) -> Self { Hash(self.0, self.1) } fn clone(&self) -> Self { *self }
} }
impl<T: Tag> PartialEq for Hash<T> { impl<T: Tag> PartialEq for Hash<T> {
fn eq(&self, other: &Hash<T>) -> bool { self.0 == other.0 } fn eq(&self, other: &Hash<T>) -> bool { self.0 == other.0 }