kvarn_utils::prelude::cmp

Enum Ordering

1.0.0 · source
#[repr(i8)]
pub enum Ordering { Less = -1, Equal = 0, Greater = 1, }
Expand description

An Ordering is the result of a comparison between two values.

§Examples

use std::cmp::Ordering;

assert_eq!(1.cmp(&2), Ordering::Less);

assert_eq!(1.cmp(&1), Ordering::Equal);

assert_eq!(2.cmp(&1), Ordering::Greater);

Variants§

§1.0.0

Less = -1

An ordering where a compared value is less than another.

§1.0.0

Equal = 0

An ordering where a compared value is equal to another.

§1.0.0<