method iter.collect
Materializes the sequence into a list.
Example:
fn main() io {
print("{(1..=4).iter().map(x => x * x).collect()}")
}Output
[1, 4, 9, 16]
pub(api) move fn collect() -> List<T>Complexity. O(n).
Since. 1.0.0-beta
Returns
List<T>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:543