Skip to content

Commit

Permalink
Fix all clippy warnings (beta toolchain version 0.1.81)
Browse files Browse the repository at this point in the history
The new `manual_inspect` lint [0] wants us to replace uses of `map`,
which return the original item, with `inspect` as it is both clearer in
intent and shorter.

[0]: https://rust-lang.github.io/rust-clippy/master/index.html#/manual_inspect

Signed-off-by: Michael Weiss <michael.weiss@eviden.com>
  • Loading branch information
primeos-work committed Jul 31, 2024
1 parent b0de361 commit 4b0fc88
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/commands/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@ async fn ping(
endpoints
.iter()
.map(|endpoint| {
let bar = progress_generator.bar().map(|bar| {
let bar = progress_generator.bar().inspect(|bar| {
bar.set_length(n_pings);
bar.set_message(format!("Pinging {}", endpoint.name()));
multibar.add(bar.clone());
bar
});

async move {
Expand Down Expand Up @@ -156,9 +155,8 @@ async fn stats(
.collect::<futures::stream::FuturesUnordered<_>>()
.collect::<Result<Vec<_>>>()
.await
.map_err(|e| {
.inspect_err(|e| {
bar.finish_with_message("Fetching stats errored");
e
})?
.into_iter()
.map(|stat| {
Expand Down

0 comments on commit 4b0fc88

Please sign in to comment.