Skip to content

Commit 930aa08

Browse files
authored
chore: fix minor clippy lints (#275)
Signed-off-by: Max Leonard Inden <mail@max-inden.de>
1 parent adc7c4e commit 930aa08

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

benches/encoding/proto.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ pub fn proto(c: &mut Criterion) {
4747
});
4848

4949
registry.register(
50-
format!("my_counter{}", i),
50+
format!("my_counter{i}"),
5151
"My counter",
5252
counter_family.clone(),
5353
);
5454
registry.register(
55-
format!("my_histogram{}", i),
55+
format!("my_histogram{i}"),
5656
"My histogram",
5757
histogram_family.clone(),
5858
);
5959

6060
for j in 0_u32..100 {
6161
counter_family
6262
.get_or_create(&CounterLabels {
63-
path: format!("/path/{}", i),
63+
path: format!("/path/{i}"),
6464
method: Method::Get,
6565
some_number: j.into(),
6666
})

benches/encoding/text.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ pub fn text(c: &mut Criterion) {
5454
});
5555

5656
registry.register(
57-
format!("my_counter_{}", i),
57+
format!("my_counter_{i}"),
5858
"My counter",
5959
counter_family.clone(),
6060
);
6161
registry.register(
62-
format!("my_histogram_{}", i),
62+
format!("my_histogram_{i}"),
6363
"My histogram",
6464
histogram_family.clone(),
6565
);

examples/axum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async fn main() {
8080
.route("/handler", get(some_handler))
8181
.with_state(metrics);
8282
let port = 8080;
83-
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", port))
83+
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{port}"))
8484
.await
8585
.unwrap();
8686

examples/custom-metric.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ fn main() {
4141
let mut encoded = String::new();
4242
encode(&mut encoded, &registry).unwrap();
4343

44-
println!("Scrape output:\n{:?}", encoded);
44+
println!("Scrape output:\n{encoded:?}");
4545
}

examples/hyper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn make_handler(
7676
Box::pin(async move {
7777
let mut buf = String::new();
7878
encode(&mut buf, &reg.clone())
79-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
79+
.map_err(std::io::Error::other)
8080
.map(|_| {
8181
let body = full(Bytes::from(buf));
8282
Response::builder()

src/encoding/text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ mod tests {
12181218
fn parse_with_python_client(input: String) {
12191219
pyo3::prepare_freethreaded_python();
12201220

1221-
println!("{:?}", input);
1221+
println!("{input:?}");
12221222
Python::with_gil(|py| {
12231223
let parser = PyModule::from_code_bound(
12241224
py,

0 commit comments

Comments
 (0)