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:
parent
e84ca292d9
commit
724be17394
|
@ -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),
|
||||
|
|
|
@ -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()))
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue