Skip to content

Commit

Permalink
NO_JIRA: [Rust] Fix new clippy lint error in Rust 1.77.0
Browse files Browse the repository at this point in the history
```
    Checking apache-avro v0.17.0 (/home/martin/git/apache/avro/lang/rust/avro)
    Checking zstd v0.13.0
    Checking hello-wasm v0.1.0 (/home/martin/git/apache/avro/lang/rust/wasm-demo)
error: useless use of `vec!`
   --> avro/src/reader.rs:679:24
    |
679 |         let expected = vec![record1.into(), record2.into()];
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[record1.into(), record2.into()]`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
    = note: `-D clippy::useless-vec` implied by `-D clippy::all`
    = help: to override `-D clippy::all` add `#[allow(clippy::useless_vec)]`

error: could not compile `apache-avro` (lib test) due to 1 previous error
```

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g committed Mar 25, 2024
1 parent 20772be commit 8866b81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lang/rust/avro/src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ mod tests {
record2.put("a", 42i64);
record2.put("b", "bar");

let expected = vec![record1.into(), record2.into()];
let expected = [record1.into(), record2.into()];

for (i, value) in reader.enumerate() {
assert_eq!(value?, expected[i]);
Expand Down

0 comments on commit 8866b81

Please sign in to comment.