Various small improvements, logging, code style #13402
GitHub Actions / Clippy Report
succeeded
Sep 20, 2024 in 0s
Clippy Report
2 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 2 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.81.0 (eeb90cda1 2024-09-04)
- cargo 1.81.0 (2dbb1af80 2024-08-20)
- clippy 0.1.81 (eeb90cd 2024-09-04)
Annotations
Check warning on line 814 in network-libp2p/src/swarm.rs
github-actions / Clippy Report
unnecessary closure used to substitute value for `Option::None`
warning: unnecessary closure used to substitute value for `Option::None`
--> network-libp2p/src/swarm.rs:811:48
|
811 | ... let response = response
| ______________________________________^
812 | | ... .ok_or_else(|| {
813 | | ... RequestError::OutboundRequest(OutboundRequestError::Timeout)
814 | | ... })
| |____________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
help: use `ok_or(..)` instead
|
812 ~ .ok_or({
813 + RequestError::OutboundRequest(OutboundRequestError::Timeout)
814 + })
|
Check warning on line 365 in network-libp2p/src/swarm.rs
github-actions / Clippy Report
this `if let` can be collapsed into the outer `match`
warning: this `if let` can be collapsed into the outer `match`
--> network-libp2p/src/swarm.rs:363:13
|
363 | / if let Some(peer_id) = peer_id {
364 | | debug!(%peer_id, "Dialing peer");
365 | | }
| |_____________^
|
help: the outer pattern can be modified to include the inner pattern
--> network-libp2p/src/swarm.rs:359:13
|
359 | peer_id,
| ^^^^^^^ replace this binding
...
363 | if let Some(peer_id) = peer_id {
| ^^^^^^^^^^^^^ with this pattern, prefixed by peer_id:
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
= note: `#[warn(clippy::collapsible_match)]` on by default
Loading