Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Rust
/
Iterators
What happens when code constructs values.iter().map(transform) but never uses the returne…
from Iterators
Rust 1.98
beginner
1 min
What happens when code constructs values.iter().map(transform) but never uses the returned iterator?
The adapter is created, but transform is not called.
transform runs immediately for every value.
Rust automatically collects the results into a Vec.
The source collection is always consumed.
Check
Ask AI about this kata
Report an error
next kata
What does this program print?
Predict the output
A new version is available
Reload