OxL Reference

method iter.first

First element or none; later elements are not pulled.

Example:

oxl✓ checked in CI
fn main() io {
  print("{[7, 8].iter().first()}")
}
Output
7
pub(api) move fn first() -> T?

Complexity. O(1): pulls one element.

Since. 1.0.0-beta

Returns

T?

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:614

See also