OxL Reference

method iter.collect

Materializes the sequence into a list.

Example:

oxl✓ checked in CI
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

See also