Skip to content

Commit f0f0a42

Browse files
committed
Remove useless calls of vec macro
linter emits: error: useless use of `vec!` As suggested remove the macro call.
1 parent 6697d15 commit f0f0a42

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

bitcoin/src/amount.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ mod tests {
23152315
fn disallow_confusing_forms() {
23162316
// Non-exhaustive list of confusing forms.
23172317
let confusing =
2318-
vec!["Msat", "Msats", "MSAT", "MSATS", "MSat", "MSats", "MBTC", "Mbtc", "PBTC"];
2318+
["Msat", "Msats", "MSAT", "MSATS", "MSat", "MSats", "MBTC", "Mbtc", "PBTC"];
23192319
for denom in confusing.iter() {
23202320
match Denomination::from_str(denom) {
23212321
Ok(_) => panic!("from_str should error for {}", denom),
@@ -2328,7 +2328,7 @@ mod tests {
23282328
#[test]
23292329
fn disallow_unknown_denomination() {
23302330
// Non-exhaustive list of unknown forms.
2331-
let unknown = vec!["NBTC", "UBTC", "ABC", "abc"];
2331+
let unknown = ["NBTC", "UBTC", "ABC", "abc"];
23322332
for denom in unknown.iter() {
23332333
match Denomination::from_str(denom) {
23342334
Ok(_) => panic!("from_str should error for {}", denom),

bitcoin/src/bip158.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ mod test {
618618
.unwrap());
619619

620620
for script in txmap.values() {
621-
let query = vec![script];
621+
let query = [script];
622622
if !script.is_empty() {
623623
assert!(filter
624624
.match_any(block_hash, &mut query.iter().map(|s| s.as_bytes()))

bitcoin/src/merkle_tree/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ mod tests {
690690

691691
let txid1 = txids[0];
692692
let txid2 = txids[1];
693-
let txids = vec![txid1, txid2];
693+
let txids = [txid1, txid2];
694694

695695
let merkle_block = MerkleBlock::from_block_with_predicate(&block, |t| txids.contains(t));
696696

0 commit comments

Comments
 (0)