Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3905

[Rust] Fix clippy error with Rust 1.74.0

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      The newly released 1.74.0 suggests the following improvement in the test code:

       

          Checking zstd v0.12.4
          Checking hello-wasm v0.1.0 (/home/martin/git/apache/avro/lang/rust/wasm-demo)
      error: this loop never actually loops
        --> avro_derive/tests/derive.rs:72:9
         |
      72 | /         for res in reader {
      73 | |             match res {
      74 | |                 Ok(value) => {
      75 | |                     return from_value::<T>(&value).unwrap();
      ...  |
      78 | |             }
      79 | |         }
         | |_________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
         = note: `-D clippy::never-loop` implied by `-D clippy::all`
         = help: to override `-D clippy::all` add `#[allow(clippy::never_loop)]`
      help: if you need the first element of the iterator, try writing
         |
      72 |         if let Some(res) = reader.next() {
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mgrigorov Martin Tzvetanov Grigorov
            mgrigorov Martin Tzvetanov Grigorov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m

                Slack

                  Issue deployment