From f8fff1c5bf303b3ae875aff01fbe4f8ce9ca3509 Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Wed, 14 Jul 2021 18:39:24 +0900 Subject: [PATCH] qcow_img: Fix warning message. warning: panic message is not a string literal --> qcow_utils/src/qcow_img.rs:52:26 | 52 | 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 | 52 | Err(f) => panic!("{}", f.to_string()), | ^^^^^ help: or use std::panic::panic_any instead | 52 | Err(f) => std::panic::panic_any(f.to_string()), | ^^^^^^^^^^^^^^^^^^^^^^ warning: 1 warning emitted BUG=None TEST=build Change-Id: I06a18610b455e57c9c9813513963385749fad17c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3026651 Tested-by: kokoro Commit-Queue: Junichi Uekawa Reviewed-by: Daniel Verkamp --- qcow_utils/src/qcow_img.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcow_utils/src/qcow_img.rs b/qcow_utils/src/qcow_img.rs index 3fdd26973c..1e28fc4c83 100644 --- a/qcow_utils/src/qcow_img.rs +++ b/qcow_utils/src/qcow_img.rs @@ -49,7 +49,7 @@ fn main() -> std::result::Result<(), ()> { let matches = match opts.parse(&args[1..]) { Ok(m) => m, - Err(f) => panic!(f.to_string()), + Err(f) => panic!("{}", f.to_string()), }; if matches.free.len() < 2 {