From 94d2a014dda2a3d7da6000e1cac0eed9adfb33bf Mon Sep 17 00:00:00 2001 From: jwhb Date: Thu, 8 May 2025 14:49:38 +0200 Subject: [PATCH] fix: clippy string format lint --- src/cli.rs | 6 +++--- tests/deserialize.rs | 2 +- tests/serialize.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 4910f18..3db0791 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -47,7 +47,7 @@ fn deserialize_stdin() { let mut buffer = String::new(); match io::stdin().read_to_string(&mut buffer) { - Err(error) => panic!("Problem opening the file: {:?}", error), + Err(error) => panic!("Problem opening the file: {error:?}"), Ok(_) => { println!("Document: {}", &buffer); @@ -55,9 +55,9 @@ fn deserialize_stdin() { let result: Result = serde_path_to_error::deserialize(deserializer); match result { - Ok(_) => println!("Result: {:?}", result), + Ok(_) => println!("Result: {result:?}"), Err(err) => { - panic!("Deserialization error: {}", err); + panic!("Deserialization error: {err}"); } } } diff --git a/tests/deserialize.rs b/tests/deserialize.rs index 52ddb97..0aa7560 100644 --- a/tests/deserialize.rs +++ b/tests/deserialize.rs @@ -13,7 +13,7 @@ fn test_deserialize_json_files(path: &Path) -> datatest_stable::Result<()> { match result { Ok(nf) => { - println!("Deserialized document: {:?}", nf); + println!("Deserialized document: {nf:?}"); Ok(()) } Err(err) => Err(serde_json::error::Error::custom(format!( diff --git a/tests/serialize.rs b/tests/serialize.rs index 97f15eb..d00b067 100644 --- a/tests/serialize.rs +++ b/tests/serialize.rs @@ -50,6 +50,6 @@ fn test_serialize() { let j = serde_json::to_string(&_a).unwrap(); let result: Nftables = serde_json::from_str(&j).unwrap(); - println!("JSON: {}", j); - println!("Parsed: {:?}", result); + println!("JSON: {j}"); + println!("Parsed: {result:?}"); }