File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -415,14 +415,22 @@ impl<F: Future> Stream for FutureGroup<F> {
415
415
}
416
416
}
417
417
418
- impl < F : Future > FromIterator < F > for FutureGroup < F > {
419
- fn from_iter < T : IntoIterator < Item = F > > ( iter : T ) -> Self {
418
+ impl < F : Future > Extend < F > for FutureGroup < F > {
419
+ fn extend < T : IntoIterator < Item = F > > ( & mut self , iter : T ) {
420
420
let iter = iter. into_iter ( ) ;
421
421
let len = iter. size_hint ( ) . 1 . unwrap_or_default ( ) ;
422
- let mut this = Self :: with_capacity ( len) ;
422
+ self . reserve ( len) ;
423
+
423
424
for future in iter {
424
- this . insert ( future) ;
425
+ self . insert ( future) ;
425
426
}
427
+ }
428
+ }
429
+
430
+ impl < F : Future > FromIterator < F > for FutureGroup < F > {
431
+ fn from_iter < T : IntoIterator < Item = F > > ( iter : T ) -> Self {
432
+ let mut this = Self :: new ( ) ;
433
+ this. extend ( iter) ;
426
434
this
427
435
}
428
436
}
You can’t perform that action at this time.
0 commit comments