diff --git a/crates/tor-chanmgr/src/builder.rs b/crates/tor-chanmgr/src/builder.rs index 8ce0dc5a2..8f86ded45 100644 --- a/crates/tor-chanmgr/src/builder.rs +++ b/crates/tor-chanmgr/src/builder.rs @@ -9,7 +9,7 @@ use crate::{event::ChanMgrEventSender, Error}; use std::time::Duration; use tor_error::internal; -use tor_linkspec::{HasChanMethod, OwnedChanTarget}; +use tor_linkspec::{HasChanMethod, IntoOwnedChanTarget, OwnedChanTarget}; use tor_proto::channel::params::ChannelPaddingInstructionsUpdates; use tor_rtcompat::{tls::TlsConnector, Runtime, TlsProvider}; @@ -85,7 +85,7 @@ where .timeout(delay, connect_future) .await .map_err(|_| Error::ChanTimeout { - peer: target.clone(), + peer: target.to_logged(), })? } } @@ -177,7 +177,7 @@ where .record_handshake_done_with_skewed_clock(); Error::Proto { source, - peer: using_target, + peer: using_target.to_logged(), clock_skew, } } @@ -185,7 +185,7 @@ where })?; let (chan, reactor) = chan.finish().await.map_err(|source| Error::Proto { source, - peer: target.clone(), + peer: target.to_logged(), clock_skew, })?; diff --git a/crates/tor-chanmgr/src/err.rs b/crates/tor-chanmgr/src/err.rs index a7c237cb2..5e26c58c2 100644 --- a/crates/tor-chanmgr/src/err.rs +++ b/crates/tor-chanmgr/src/err.rs @@ -8,7 +8,7 @@ use thiserror::Error; use crate::factory::AbstractPtError; use tor_error::{internal, ErrorKind}; -use tor_linkspec::{ChanTarget, OwnedChanTarget, PtTargetAddr}; +use tor_linkspec::{ChanTarget, IntoOwnedChanTarget, LoggedChanTarget, PtTargetAddr}; use tor_proto::ClockSkew; use crate::transport::proxied::ProxyError; @@ -25,14 +25,14 @@ pub enum Error { #[error("Pending channel for {peer} failed to launch")] PendingFailed { /// Who we were talking to - peer: OwnedChanTarget, + peer: LoggedChanTarget, }, /// It took too long for us to establish this connection. #[error("Channel for {peer} timed out")] ChanTimeout { /// Who we were trying to talk to - peer: OwnedChanTarget, + peer: LoggedChanTarget, }, /// A protocol error while making a channel @@ -42,7 +42,7 @@ pub enum Error { #[source] source: tor_proto::Error, /// Who we were trying to talk to - peer: OwnedChanTarget, + peer: LoggedChanTarget, /// An authenticated ClockSkew (if available) that we received from the /// peer. clock_skew: Option, @@ -225,7 +225,7 @@ impl Error { ) -> Self { Error::Proto { source, - peer: OwnedChanTarget::from_chan_target(peer), + peer: peer.to_logged(), clock_skew: None, } }