Skip to content

Commit 0166afa

Browse files
author
Ariel Ben-Yehuda
committed
chore: fix clippy
This is has a slight behavior change of making LocalReporter return a LocalReporterError instead of an IO error, but that sort of error behavior is not actually specified.
1 parent 4eadf58 commit 0166afa

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

src/metadata/aws.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,9 @@ async fn read_fargate_metadata(
9696
"not running on fargate".into(),
9797
));
9898
};
99-
let uri = format!(
100-
"{}/task",
101-
// Only available if running on Fargate. Something like
102-
// `http://169.254.232.106/v4/5261e761e0e2a3d92da3f02c8e5bab1f-3356750833`.
103-
md_uri
104-
);
99+
// Only available if running on Fargate. Something like
100+
// `http://169.254.232.106/v4/5261e761e0e2a3d92da3f02c8e5bab1f-3356750833`.
101+
let uri = format!("{md_uri}/task",);
105102

106103
let req = http_client
107104
.request(Method::GET, uri.clone())

src/profiler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl ProfilerOptions {
9999
jfr_file_path.display()
100100
);
101101
if let Some(ref native_mem) = self.native_mem {
102-
args.push_str(&format!(",nativemem={}", native_mem));
102+
args.push_str(&format!(",nativemem={native_mem}"));
103103
}
104104
args
105105
}

src/reporter/local.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Reporter for LocalReporter {
6161
) -> Result<(), Box<dyn std::error::Error + Send>> {
6262
self.report_profiling_data(jfr, metadata)
6363
.await
64-
.map_err(|e| Box::new(e) as _)
64+
.map_err(|e| Box::new(LocalReporterError::IoError(e)) as _)
6565
}
6666
}
6767

src/reporter/multi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl fmt::Display for MultiError {
2424
write!(f, ", ")?;
2525
}
2626
first = false;
27-
write!(f, "{}: {}", reporter, err)?;
27+
write!(f, "{reporter}: {err}")?;
2828
}
2929
write!(f, "}}")
3030
}
@@ -57,7 +57,7 @@ impl Reporter for MultiReporter {
5757
reporter
5858
.report(jfr_ref.to_owned(), metadata)
5959
.await
60-
.map_err(move |e| (format!("{:?}", reporter), e))
60+
.map_err(move |e| (format!("{reporter:?}"), e))
6161
}))
6262
.await;
6363
// return all errors

0 commit comments

Comments
 (0)