Skip to content

Commit

Permalink
Fix all non_fmt_panic compilation warnings
Browse files Browse the repository at this point in the history
They look like this:

    warning: panic message is not a string literal
    --> examples/syntest.rs:277:28
        |
    277 |         Err(f) => { panic!(f.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
        |
    277 |         Err(f) => { panic!("{}", f.to_string()) }
        |                            ^^^^^
    help: or use std::panic::panic_any instead
        |
    277 |         Err(f) => { std::panic::panic_any(f.to_string()) }
        |                     ^^^^^^^^^^^^^^^^^^^^^
  • Loading branch information
Enselic committed Jul 5, 2021
1 parent 6bcec62 commit b436fb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/syncat.rs
Expand Up @@ -39,7 +39,7 @@ fn main() {

let matches = match opts.parse(&args[1..]) {
Ok(m) => { m }
Err(f) => { panic!(f.to_string()) }
Err(f) => { panic!("{}", f.to_string()) }
};

let no_newlines = matches.opt_present("no-newlines");
Expand Down
2 changes: 1 addition & 1 deletion examples/syntest.rs
Expand Up @@ -274,7 +274,7 @@ fn main() {

let matches = match opts.parse(&args[1..]) {
Ok(m) => { m }
Err(f) => { panic!(f.to_string()) }
Err(f) => { panic!("{}", f.to_string()) }
};

let tests_path = if matches.free.len() < 1 {
Expand Down

0 comments on commit b436fb9

Please sign in to comment.