Try_collect as iter consuming operation

I think collect should just work with an Option target:

fn main() {
    let not_all = vec![Some(2), Some(3), None];
    let all = vec![Some(2), Some(3), Some(4)];

    let collected_not_all: Option<Vec<_>> =
        not_all.into_iter().collect();
    let collected_all: Option<Vec<_>> =
        all.into_iter().collect();

    println!("not all: {:?}", collected_not_all);
    println!("all: {:?}", collected_all);
}

gives me

not all: None
all: Some([2, 3, 4])

Unless I'm missing something.

Edit: This is because you can collect into anything implementing FromIterator, and there is one for Option collection targets from iterators that produce Option values.