Skip to content

Commit 5e97421

Browse files
committed
schnauzer: apply clippy fixes
1 parent 6f22cba commit 5e97421

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

sources/api/schnauzer/src/v1.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub mod cli {
234234
/// Returns the value of a metadata key for a given data key, erroring if the value is not a
235235
/// string or is empty.
236236
async fn get_metadata(key: &str, meta: &str) -> Result<String> {
237-
let uri = &format!("{}{}?keys={}", API_METADATA_URI_BASE, meta, key);
237+
let uri = &format!("{API_METADATA_URI_BASE}{meta}?keys={key}");
238238
let method = "GET";
239239
let (code, response_body) =
240240
apiclient::raw_request(constants::API_SOCKET, &uri, method, None)
@@ -276,7 +276,7 @@ pub mod cli {
276276
/// Print usage message.
277277
fn usage() -> ! {
278278
let program_name = env::args().next().unwrap_or_else(|| "program".to_string());
279-
eprintln!("Usage: {} SETTING_KEY", program_name);
279+
eprintln!("Usage: {program_name} SETTING_KEY");
280280
process::exit(2);
281281
}
282282

@@ -313,7 +313,7 @@ pub mod cli {
313313
let output = serde_json::to_string(&setting)
314314
.context(error::SerializeOutputSnafu { output: &setting })?;
315315

316-
println!("{}", output);
316+
println!("{output}");
317317
Ok(())
318318
}
319319
}

sources/api/schnauzer/tests/multicall_integration.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ impl MulticallTest {
2828
/// Create a symlink to the binary with the given name
2929
fn create_symlink(&self, name: &str) -> PathBuf {
3030
let link_path = self.temp_dir.path().join(name);
31-
symlink(self.binary_path, &link_path).expect(&format!("Failed to create {} symlink", name));
31+
symlink(self.binary_path, &link_path)
32+
.unwrap_or_else(|_| panic!("Failed to create {name} symlink"));
3233
link_path
3334
}
3435

@@ -37,10 +38,7 @@ impl MulticallTest {
3738
Command::new(binary_path)
3839
.args(args)
3940
.output()
40-
.expect(&format!(
41-
"Failed to execute {:?} with args {:?}",
42-
binary_path, args
43-
))
41+
.unwrap_or_else(|_| panic!("Failed to execute {binary_path:?} with args {args:?}"))
4442
}
4543

4644
/// Check if the output contains v1-specific usage message
@@ -55,9 +53,9 @@ impl MulticallTest {
5553
let stdout = String::from_utf8_lossy(&output.stdout);
5654

5755
// v2 has different usage patterns - look for v2-specific elements
58-
(stderr.contains("render-file")
56+
stderr.contains("render-file")
5957
|| stderr.contains("render")
60-
|| stdout.contains("--log-level") && !self.is_v1_output(output))
58+
|| stdout.contains("--log-level") && !self.is_v1_output(output)
6159
}
6260
}
6361

0 commit comments

Comments
 (0)