From 9dc82852614ed0795348cdf539de7455680cd3b7 Mon Sep 17 00:00:00 2001 From: Max Leonard Inden Date: Mon, 4 Aug 2025 10:58:43 +0200 Subject: [PATCH] chore: fix minor clippy lints Signed-off-by: Max Leonard Inden --- benches/encoding/proto.rs | 6 +++--- benches/encoding/text.rs | 4 ++-- examples/axum.rs | 2 +- examples/custom-metric.rs | 2 +- examples/hyper.rs | 2 +- src/encoding/text.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/benches/encoding/proto.rs b/benches/encoding/proto.rs index 6817b656..da3a182d 100644 --- a/benches/encoding/proto.rs +++ b/benches/encoding/proto.rs @@ -47,12 +47,12 @@ pub fn proto(c: &mut Criterion) { }); registry.register( - format!("my_counter{}", i), + format!("my_counter{i}"), "My counter", counter_family.clone(), ); registry.register( - format!("my_histogram{}", i), + format!("my_histogram{i}"), "My histogram", histogram_family.clone(), ); @@ -60,7 +60,7 @@ pub fn proto(c: &mut Criterion) { for j in 0_u32..100 { counter_family .get_or_create(&CounterLabels { - path: format!("/path/{}", i), + path: format!("/path/{i}"), method: Method::Get, some_number: j.into(), }) diff --git a/benches/encoding/text.rs b/benches/encoding/text.rs index 079cf52a..52b13f4e 100644 --- a/benches/encoding/text.rs +++ b/benches/encoding/text.rs @@ -54,12 +54,12 @@ pub fn text(c: &mut Criterion) { }); registry.register( - format!("my_counter_{}", i), + format!("my_counter_{i}"), "My counter", counter_family.clone(), ); registry.register( - format!("my_histogram_{}", i), + format!("my_histogram_{i}"), "My histogram", histogram_family.clone(), ); diff --git a/examples/axum.rs b/examples/axum.rs index bf852559..c3e81705 100644 --- a/examples/axum.rs +++ b/examples/axum.rs @@ -80,7 +80,7 @@ async fn main() { .route("/handler", get(some_handler)) .with_state(metrics); let port = 8080; - let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", port)) + let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}")) .await .unwrap(); diff --git a/examples/custom-metric.rs b/examples/custom-metric.rs index a61ff8a7..576cfaa8 100644 --- a/examples/custom-metric.rs +++ b/examples/custom-metric.rs @@ -41,5 +41,5 @@ fn main() { let mut encoded = String::new(); encode(&mut encoded, ®istry).unwrap(); - println!("Scrape output:\n{:?}", encoded); + println!("Scrape output:\n{encoded:?}"); } diff --git a/examples/hyper.rs b/examples/hyper.rs index bbab0058..2ed18de4 100644 --- a/examples/hyper.rs +++ b/examples/hyper.rs @@ -76,7 +76,7 @@ pub fn make_handler( Box::pin(async move { let mut buf = String::new(); encode(&mut buf, ®.clone()) - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)) + .map_err(std::io::Error::other) .map(|_| { let body = full(Bytes::from(buf)); Response::builder() diff --git a/src/encoding/text.rs b/src/encoding/text.rs index 80b91076..6e090baf 100644 --- a/src/encoding/text.rs +++ b/src/encoding/text.rs @@ -1218,7 +1218,7 @@ mod tests { fn parse_with_python_client(input: String) { pyo3::prepare_freethreaded_python(); - println!("{:?}", input); + println!("{input:?}"); Python::with_gil(|py| { let parser = PyModule::from_code_bound( py,