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

Rust: fix panic messages in test code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.11.0
    • rust

    Description

      Running `cargo test` (Rust 1.53.0) produces the following warnings:

       

      warning: panic message is not a string literal
          --> tests/schema.rs:1173:13
           |
      1173 |             e.to_string()
           |             ^^^^^^^^^^^^^
           |
           = note: `#[warn(non_fmt_panic)]` on by default
           = note: this is no longer accepted in Rust 2021
      help: add a "{}" format string to Display the message
           |
      1173 |             "{}", e.to_string()
           |             ^^^^^warning: 1 warning emitted
       

       

       warning: panic message is not a string literal
         --> tests/io.rs:105:13
          |
      105 |             format!("value {:?} does not validate schema: {}", value, raw_schema)
          |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          |
          = note: `#[warn(non_fmt_panic)]` on by default
          = note: this is no longer accepted in Rust 2021
          = note: the panic!() macro supports formatting, so there's no need for the format!() macro here
      help: remove the `format!(..)` macro call
          |
      105 |             "value {:?} does not validate schema: {}", value, raw_schema
          |            --                                                          --warning: 1 warning emitted

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            mgrigorov Martin Tzvetanov Grigorov
            Votes:
            0 Vote for this issue
            Watchers:
            1 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