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()}")
}Вывод
true false
pub(api) move fn isEmpty() -> boolСложность. O(1): pulls at most one element.
С версии. 1.0.0-beta
Возвращает
bool
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/core/iter.oxl:596