Fix clippy::useless_vec warning in test

```
warning: useless use of `vec!`
 --> tests/smoke.rs:8:13
  |
8 |     let v = vec![2, 3, 5, 7, 11];
  |             ^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[2, 3, 5, 7, 11]`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
  = note: `#[warn(clippy::useless_vec)]` on by default

warning: useless use of `vec!`
  --> tests/smoke.rs:21:13
   |
21 |     let v = vec![10, 20, 30];
   |             ^^^^^^^^^^^^^^^^ help: you can use an array directly: `[10, 20, 30]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec

warning: useless use of `vec!`
  --> tests/smoke.rs:30:13
   |
30 |     let v = vec![10, 20, 30];
   |             ^^^^^^^^^^^^^^^^ help: you can use an array directly: `[10, 20, 30]`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
```
This commit is contained in:
Taiki Endo 2023-09-10 20:50:00 +09:00
parent d40a8747f6
commit e86ac7cfc9
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ use easy_parallel::Parallel;
#[test]
fn smoke() {
let m = Mutex::new(0);
let v = vec![2, 3, 5, 7, 11];
let v = [2, 3, 5, 7, 11];
Parallel::new()
.add(|| *m.lock().unwrap() += 10)
@ -18,7 +18,7 @@ fn smoke() {
#[test]
fn squares() {
let v = vec![10, 20, 30];
let v = [10, 20, 30];
let squares = Parallel::new().each(0..v.len(), |i| v[i] * v[i]).run();
@ -27,7 +27,7 @@ fn squares() {
#[test]
fn finish() {
let v = vec![10, 20, 30];
let v = [10, 20, 30];
let (squares, len) = Parallel::new()
.each(0..v.len(), |i| v[i] * v[i])