method iter.isEmpty
true if the sequence has no elements (consumes the iterator).
Example:
fn main() io {
let none_here: List<i32> = []
print("{none_here.iter().isEmpty()} {[1].iter().isEmpty()}")
}Output
true false
pub(api) move fn isEmpty() -> boolComplexity. O(1): pulls at most one element.
Since. 1.0.0-beta
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:596