File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -102,22 +102,21 @@ impl<C: NetworkConnector<Stream=S>, S: NetworkStream + Send> NetworkConnector fo
102102 type Stream = PooledStream < S > ;
103103 fn connect ( & self , host : & str , port : u16 , scheme : & str ) -> :: Result < PooledStream < S > > {
104104 let key = key ( host, port, scheme) ;
105- let mut locked = self . inner . lock ( ) . unwrap ( ) ;
106105 let mut should_remove = false ;
107- let inner = match locked . conns . get_mut ( & key) {
106+ let inner = match self . inner . lock ( ) . unwrap ( ) . conns . get_mut ( & key) {
108107 Some ( ref mut vec) => {
109108 trace ! ( "Pool had connection, using" ) ;
110109 should_remove = vec. len ( ) == 1 ;
111110 vec. pop ( ) . unwrap ( )
112111 }
113- _ => PooledStreamInner {
112+ None => PooledStreamInner {
114113 key : key. clone ( ) ,
115114 stream : try!( self . connector . connect ( host, port, scheme) ) ,
116115 previous_response_expected_no_content : false ,
117116 }
118117 } ;
119118 if should_remove {
120- locked . conns . remove ( & key) ;
119+ self . inner . lock ( ) . unwrap ( ) . conns . remove ( & key) ;
121120 }
122121 Ok ( PooledStream {
123122 inner : Some ( inner) ,
You can’t perform that action at this time.
0 commit comments