Code
fn main() {
for _ in [1, 2, 3].iter()map(|x| x) {}
}
Current output
error: expected `{`, found `map`
--> src/main.rs:2:30
|
2 | for _ in [1, 2, 3].iter()map(|x| x) {}
| ^^^ expected `{`
|
help: try placing this code inside a block
|
2 | for _ in [1, 2, 3].iter(){ map(|x| x) } {}
| + +
Desired output
error: expected `{`, found `map`
--> src/main.rs:2:30
|
2 | for _ in [1, 2, 3].iter()map(|x| x) {}
| ^^^ expected `{`
|
help: you might have meant to call a method
|
2 | for _ in [1, 2, 3].iter().map(|x| x) {}
| +
Rationale and extra context
No response
Other cases
No response
Rust Version
1.82
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
No response
Rust Version
1.82
Anything else?
No response