Remove useless usage of vec! macro

Clippy emits a bunch of warnings of form:

  warning: useless use of `vec!`

As suggested, remove the vec and just use an array.
This commit is contained in:
Tobin C. Harding 2023-08-25 12:30:04 +10:00
parent e84ca292d9
commit 724be17394
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
3 changed files with 4 additions and 5 deletions

View File

@ -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),

View File

@ -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()))

View File

@ -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));