The example implementation of the FromIterator trait in the Rust docs is:
impl FromIterator<i32> for MyCollection {
fn from_iter<I: IntoIterator<Item=i32>>(iter: I) -> Self {
let mut c = MyCollection::new();
for i in iter {
c.add(i);
}
c
}
}
FromIterator defines how a type will be created from an iterator. The signature of from_iter requires a type that implements IntoIterator, which defines how a type may be converted into an Iterator.
Is from_iter defined this way because IntoIterator is not as strict a requirement as Iterator?