im 4.1.0

Assorted immutable collection datatypes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub fn is_sorted<A, I>(l: I) -> bool
where
    I: IntoIterator<Item = A>,
    A: Ord,
{
    let mut it = l.into_iter().peekable();
    loop {
        match (it.next(), it.peek()) {
            (_, None) => return true,
            (Some(ref a), Some(ref b)) if a > b => return false,
            _ => (),
        }
    }
}