From b436fb9d6bd8c896550c2671600e0112d6124f6f Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 5 Jul 2021 09:58:45 +0200 Subject: [PATCH] Fix all non_fmt_panic compilation warnings 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()) } | ^^^^^^^^^^^^^^^^^^^^^ --- examples/syncat.rs | 2 +- examples/syntest.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/syncat.rs b/examples/syncat.rs index cb6af2f5..f33f1312 100644 --- a/examples/syncat.rs +++ b/examples/syncat.rs @@ -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"); diff --git a/examples/syntest.rs b/examples/syntest.rs index aa4abc30..13e1d6ce 100644 --- a/examples/syntest.rs +++ b/examples/syntest.rs @@ -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 {