Function rufl::collection::is_descending_order

source ·
pub fn is_descending_order<C: AsRef<[T]>, T: Ord>(collection: &C) -> bool
Expand description

Checks if all elements are in descending order within collection.

§Arguments

  • collection - The collection to perform check.

§Returns

Returns true if all elements are in descending order within collection.

§Examples

use rufl::collection;

assert_eq!(false, collection::is_descending_order(&[1, 2, 3]));

assert_eq!(true, collection::is_descending_order(&[3, 2, 1]));