This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/main by this push:
     new 8866b8101 NO_JIRA: [Rust] Fix new clippy lint error in Rust 1.77.0
8866b8101 is described below

commit 8866b81016816dc4a6b45027e02506783c4567fd
Author: Martin Tzvetanov Grigorov <[email protected]>
AuthorDate: Mon Mar 25 13:24:24 2024 +0200

    NO_JIRA: [Rust] Fix new clippy lint error in Rust 1.77.0
    
    ```
        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]>
---
 lang/rust/avro/src/reader.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lang/rust/avro/src/reader.rs b/lang/rust/avro/src/reader.rs
index 9a3be4c87..adefed203 100644
--- a/lang/rust/avro/src/reader.rs
+++ b/lang/rust/avro/src/reader.rs
@@ -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]);

Reply via email to