File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11use crate :: iter:: FromIterator ;
22
3- /// Collapses all unit items from an iterator into one .
3+ /// Drains all items from an iterator.
44///
5- /// This is more useful when combined with higher-level abstractions, like
6- /// collecting to a `Result<(), E>` where you only care about errors:
5+ /// This is useful to run an iterator to completion when you don't
6+ /// care about the result, or to collect into a `Result<(), E>` when
7+ /// you only care about errors:
78///
89/// ```
910/// use std::io::*;
@@ -14,8 +15,8 @@ use crate::iter::FromIterator;
1415/// assert!(res.is_ok());
1516/// ```
1617#[ stable( feature = "unit_from_iter" , since = "1.23.0" ) ]
17- impl FromIterator < ( ) > for ( ) {
18- fn from_iter < I : IntoIterator < Item = ( ) > > ( iter : I ) -> Self {
19- iter. into_iter ( ) . for_each ( |( ) | { } )
18+ impl < T > FromIterator < T > for ( ) {
19+ fn from_iter < A : IntoIterator < Item = T > > ( iter : A ) -> Self {
20+ iter. into_iter ( ) . for_each ( |_ | { } )
2021 }
2122}
You can’t perform that action at this time.
0 commit comments