This is a typical function convention in allalmost all programming languages, except for those that are erroneous. Conversely, anyreturns falsefor empty sequences.
, . , , . , ? , , - . conditions.all(|value| condition.fulfilled(value)) true .
all " ", , all :
fn all<F>(&mut self, f: F) -> bool
where
F: FnMut(Self::Item) -> bool,
{
for v in self {
if !f(v) {
return false;
}
}
return true;
}
, - .