mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
rust: Fix deprecated use of panic!(format!(...))
warning: panic message is not a string literal
--> src/bin/event_leak.rs:9:30
|
9 | Err(e) => panic!(format!(" could not create handle {:?}", e)),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(non_fmt_panic)]` on by default
= note: this is no longer accepted in Rust 2021
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
This commit is contained in:
@@ -992,7 +992,7 @@ and generate_rust_bindtests () =
|
||||
pr "fn main() {\n";
|
||||
pr " let g = match Handle::create() {\n";
|
||||
pr " Ok(g) => g,\n";
|
||||
pr " Err(e) => panic!(format!(\" could not create handle {:?}\", e)),\n";
|
||||
pr " Err(e) => panic!(\"could not create handle {:?}\", e),\n";
|
||||
pr " };\n";
|
||||
generate_lang_bindtests (
|
||||
fun f args optargs ->
|
||||
|
||||
@@ -5,7 +5,7 @@ fn main() {
|
||||
for _ in 0..256 {
|
||||
let mut g = match Handle::create() {
|
||||
Ok(g) => g,
|
||||
Err(e) => panic!(format!(" could not create handle {:?}", e)),
|
||||
Err(e) => panic!("could not create handle {:?}", e),
|
||||
};
|
||||
g.set_event_callback(
|
||||
|e, _, _, _| match e {
|
||||
|
||||
@@ -6,7 +6,7 @@ fn main() {
|
||||
for _ in 0..256 {
|
||||
let mut g = match Handle::create() {
|
||||
Ok(g) => g,
|
||||
Err(e) => panic!(format!(" could not create handle {:?}", e)),
|
||||
Err(e) => panic!("could not create handle {:?}", e),
|
||||
};
|
||||
g.set_event_callback(
|
||||
|e, _, _, _| match e {
|
||||
|
||||
Reference in New Issue
Block a user