Closed
Description
This code produces no output:
fn main() {
let xs = &[1u,2u,3u];
let f = |x: &uint| {
println!("{:u}", *x);
};
xs.iter().map(f);
}
It's because the iterator returned by map
is never used. Switching to .map(f).last()
produces the expected output.
Perhaps iterator structs should be #[must_use]
?
Metadata
Metadata
Assignees
Labels
No labels