Skip to content

Commit

Permalink
chore: fix clippy::unnecessary_fallible_conversions warning (#507)
Browse files Browse the repository at this point in the history
This fixes a new clippy lint added in 1.75. This warning is currently
causing CI failure:
https://github.com/tokio-rs/console/actions/runs/7437067584/job/20234273745?pr=506.

```
error: use of a fallible conversion when an infallible one could be used
   --> tokio-console/src/conn.rs:106:40
    |
106 |                         let endpoint = Endpoint::try_from(self.target.clone())?;
    |                                        ^^^^^^^^^^^^^^^^^^ help: use: `From::from`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
    = note: `-D clippy::unnecessary-fallible-conversions` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_fallible_conversions)]`
```
  • Loading branch information
taiki-e authored Jan 7, 2024
1 parent 96c65bd commit bb3cb92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tokio-console/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl Connection {
return Err("unix domain sockets are not supported on this platform".into());
}
_ => {
let endpoint = Endpoint::try_from(self.target.clone())?;
let endpoint = Endpoint::from(self.target.clone());
endpoint.connect().await?
}
};
Expand Down

0 comments on commit bb3cb92

Please sign in to comment.