File tree 1 file changed +3
-10
lines changed
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ use std::convert::TryFrom;
11
11
use std:: fmt:: Debug ;
12
12
use std:: io;
13
13
use std:: str:: FromStr ;
14
- use std:: sync:: Arc ;
15
14
16
15
type HyperRequest = hyper:: Request < hyper:: Body > ;
17
16
@@ -28,28 +27,22 @@ impl<C: Clone + Connect + Debug + Send + Sync + 'static> HyperClientObject for h
28
27
29
28
/// Hyper-based HTTP Client.
30
29
#[ derive( Debug ) ]
31
- pub struct HyperClient ( Arc < dyn HyperClientObject > ) ;
30
+ pub struct HyperClient ( Box < dyn HyperClientObject > ) ;
32
31
33
32
impl HyperClient {
34
33
/// Create a new client instance.
35
34
pub fn new ( ) -> Self {
36
35
let https = HttpsConnector :: new ( ) ;
37
36
let client = hyper:: Client :: builder ( ) . build ( https) ;
38
- Self ( Arc :: new ( client) )
37
+ Self ( Box :: new ( client) )
39
38
}
40
39
41
40
/// Create from externally initialized and configured client.
42
41
pub fn from_client < C > ( client : hyper:: Client < C > ) -> Self
43
42
where
44
43
C : Clone + Connect + Debug + Send + Sync + ' static ,
45
44
{
46
- Self ( Arc :: new ( client) )
47
- }
48
- }
49
-
50
- impl Clone for HyperClient {
51
- fn clone ( & self ) -> Self {
52
- Self ( self . 0 . clone ( ) )
45
+ Self ( Box :: new ( client) )
53
46
}
54
47
}
55
48
You can’t perform that action at this time.
0 commit comments