1
- use std:: marker:: PhantomData ;
2
-
3
1
use super :: { Connector , Transport } ;
4
2
5
3
/// Chain of up to 8 connectors
6
4
///
7
5
/// Can be created manually from a tuple of connectors through `ChainedConnector::new`
8
6
#[ derive( Debug ) ]
9
- pub struct ChainedConnector < In , Connectors > ( Connectors , PhantomData < In > ) ;
7
+ pub struct ChainedConnector < Connectors > ( Connectors ) ;
10
8
11
- impl < In , Connectors > ChainedConnector < In , Connectors > {
9
+ impl < Connectors > ChainedConnector < Connectors > {
12
10
/// Create a new chained connector that chains a tuple of connectors
13
11
///
14
12
/// ```rust
15
13
/// # use ureq::unversioned::transport::{ChainedConnector, SocsConnector, TcpConnector, RustlsConnector, ConnectProxyConnector};
16
14
/// let connector: ChainedConnector<(), (SocsConnector, TcpConnector, RustlsConnector, ConnectProxyConnector)> = ChainedConnector::new(SocsConnector::default(), TcpConnector::default(), RustlsConnector::default(), ConnectProxyConnector::default());
17
15
/// ```
18
16
pub fn new ( connectors : Connectors ) -> Self {
19
- Self ( connectors, PhantomData )
17
+ Self ( connectors)
20
18
}
21
19
}
22
20
23
21
macro_rules! impl_chained_connectors {
24
22
( ( $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) >
26
24
where
27
25
In : Transport ,
28
26
$first_ty: Connector <In >,
@@ -39,7 +37,7 @@ macro_rules! impl_chained_connectors {
39
37
ref $first_name,
40
38
$( ref $name, ) *
41
39
ref $final_name,
42
- ) , _ ) = self ;
40
+ ) ) = self ;
43
41
44
42
let out = $first_name. connect( details, chained) ?;
45
43
$(
0 commit comments