Skip to content

Commit ccfc864

Browse files
ChainedConnector: Remove In generic parameter
1 parent 80340b3 commit ccfc864

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/unversioned/transport/chain.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
use std::marker::PhantomData;
2-
31
use super::{Connector, Transport};
42

53
/// Chain of up to 8 connectors
64
///
75
/// Can be created manually from a tuple of connectors through `ChainedConnector::new`
86
#[derive(Debug)]
9-
pub struct ChainedConnector<In, Connectors>(Connectors, PhantomData<In>);
7+
pub struct ChainedConnector<Connectors>(Connectors);
108

11-
impl<In, Connectors> ChainedConnector<In, Connectors> {
9+
impl<Connectors> ChainedConnector<Connectors> {
1210
/// Create a new chained connector that chains a tuple of connectors
1311
///
1412
/// ```rust
1513
/// # use ureq::unversioned::transport::{ChainedConnector, SocsConnector, TcpConnector, RustlsConnector, ConnectProxyConnector};
1614
/// let connector: ChainedConnector<(), (SocsConnector, TcpConnector, RustlsConnector, ConnectProxyConnector)> = ChainedConnector::new(SocsConnector::default(), TcpConnector::default(), RustlsConnector::default(), ConnectProxyConnector::default());
1715
/// ```
1816
pub fn new(connectors: Connectors) -> Self {
19-
Self(connectors, PhantomData)
17+
Self(connectors)
2018
}
2119
}
2220

2321
macro_rules! impl_chained_connectors {
2422
(($first_ty:ident, $first_name: ident) ; $(($ty:ident, $name:ident, $prev_ty:ident)),* ; ($final_ty:ident, $final_name: ident, $pre_final_ty:ident)) => {
25-
impl<In, $first_ty, $($ty,)* $final_ty> Connector<In> for ChainedConnector<In, ($first_ty, $($ty,)* $final_ty)>
23+
impl<In, $first_ty, $($ty,)* $final_ty> Connector<In> for ChainedConnector<($first_ty, $($ty,)* $final_ty)>
2624
where
2725
In: Transport,
2826
$first_ty: Connector<In>,
@@ -39,7 +37,7 @@ macro_rules! impl_chained_connectors {
3937
ref $first_name,
4038
$(ref $name,)*
4139
ref $final_name,
42-
), _) = self;
40+
)) = self;
4341

4442
let out = $first_name.connect(details, chained)?;
4543
$(

src/unversioned/transport/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub trait Connector<In: Transport = ()>: Debug + Send + Sync + 'static {
132132
/// Chain this connector to another connector.
133133
///
134134
/// This connector will be called first, and the output goes into the next connector.
135-
fn chain<Next: Connector<Self::Out>>(self, next: Next) -> ChainedConnector<In, (Self, Next)>
135+
fn chain<Next: Connector<Self::Out>>(self, next: Next) -> ChainedConnector<(Self, Next)>
136136
where
137137
Self: Sized,
138138
{

0 commit comments

Comments
 (0)