@@ -168,17 +168,11 @@ mod tests {
168
168
let ( a_inc, b_inc) = futures:: future:: join ( a_tun. downlink ( ) , b_tun. downlink ( ) ) . await ;
169
169
let ( mut a_inc, mut b_inc) = ( a_inc. unwrap ( ) , b_inc. unwrap ( ) ) ;
170
170
drop ( a_tun) ; // Dropping the A tunnel ends the incoming streams for B
171
- let count_of_b: u32 = b_inc
172
- . as_stream ( )
173
- . fold ( 0 , async move |memo, _stream| memo + 1 )
174
- . await ;
171
+ let count_of_b: usize = b_inc. as_stream ( ) . count ( ) . await ;
175
172
assert_eq ! ( count_of_b, 1 ) ;
176
173
b_tun. open_link ( ) . await . unwrap ( ) ;
177
174
drop ( b_tun) ; // Dropping the B tunnel ends the incoming streams for A
178
- let count_of_a: u32 = a_inc
179
- . as_stream ( )
180
- . fold ( 0 , async move |memo, _stream| memo + 1 )
181
- . await ;
175
+ let count_of_a: usize = a_inc. as_stream ( ) . count ( ) . await ;
182
176
assert_eq ! ( count_of_a, 1 ) ;
183
177
} ;
184
178
tokio:: time:: timeout ( std:: time:: Duration :: from_secs ( 5 ) , fut)
@@ -217,7 +211,7 @@ mod tests {
217
211
TunnelIncomingType :: BiStream ( stream) => Ok ( Some ( stream) ) ,
218
212
} )
219
213
} )
220
- . try_for_each_concurrent ( None , async move |stream : WrappedStream | {
214
+ . try_for_each_concurrent ( None , |stream : WrappedStream | async move {
221
215
let ( mut incoming_downlink, _incoming_uplink) = tokio:: io:: split ( stream) ;
222
216
let ( _outgoing_downlink, mut outgoing_uplink) =
223
217
tokio:: io:: split ( server_ref. open_link ( ) . await . unwrap ( ) ) ;
0 commit comments