From bb3cb92b8c459fa8224b6bfb586053747652a2b9 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Mon, 8 Jan 2024 04:58:40 +0900 Subject: [PATCH] chore: fix clippy::unnecessary_fallible_conversions warning (#507) 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)]` ``` --- tokio-console/src/conn.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokio-console/src/conn.rs b/tokio-console/src/conn.rs index 79fa31019..8cfd4bf51 100644 --- a/tokio-console/src/conn.rs +++ b/tokio-console/src/conn.rs @@ -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? } };