Closed
Description
The docs led me to believe that fuse would yield items until it saw a None, and then yield only Nones. Maybe I'm misunderstanding, but
let v = vec!["0", "a", "1", "2"];
let it: Vec<Option<i32>> = v.iter().map(|x| x.parse().ok()).fuse().inspect(|x| println!("inspected {:?}",x)).collect();
println!("it:{:?}", it);
outputs
inspected Some(0)
inspected None
inspected Some(1)
inspected Some(2)
it:[Some(0), None, Some(1), Some(2)]
whereas I'd expect to see something like it:[Some(0), None, None, None]
rustc 1.28.0-nightly (cb20f68 2018-05-21)
Metadata
Metadata
Assignees
Labels
No labels