diff --git a/src/forward_traffic.rs b/src/forward_traffic.rs index cf08b8a..9914170 100644 --- a/src/forward_traffic.rs +++ b/src/forward_traffic.rs @@ -1,4 +1,3 @@ -use crate::NeverOkResult; use err_context::BoxedErrorExt as _; use err_context::ResultExt as _; use futures::future::select; @@ -41,7 +40,7 @@ pub async fn process_udp_over_tcp( } }; let udp2tcp = async move { - let error = process_udp2tcp(udp_in, tcp_out).await.into_error(); + let Err(error) = process_udp2tcp(udp_in, tcp_out).await; log::error!("Error: {}", error.display("\nCaused by: ")); }; diff --git a/src/lib.rs b/src/lib.rs index b0a9db4..274b9cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -95,15 +95,3 @@ pub use tcp_options::{ApplyTcpOptionsError, ApplyTcpOptionsErrorKind, TcpOptions /// Size of the header (in bytes) that is prepended to each datagram in the TCP stream. pub use forward_traffic::HEADER_LEN; - -/// Helper trait for `Result` types. Allows getting the `E` value -/// in a way that is guaranteed to not panic. -pub trait NeverOkResult { - fn into_error(self) -> E; -} - -impl NeverOkResult for Result { - fn into_error(self) -> E { - self.expect_err("Result can't be Ok variant") - } -}