14
cmp::Ordering vs comparison symbols
(programming.dev)
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits
~~What language?~~ (I'm an idiot) If you're referring to Rust,
std::cmp::Orderingis an enum and can be used withPartialOrd/Ordto see how two values compare. The comparison operators basically call yourpartial_ordimplementation. If you can use the operators themselves, use them instead of callingpartial_ordin most cases.~~In other languages, I don't know, but I assume in general if you can use the operators, you should (unless you're interested specifically in their ordering, not whether one is only one of greater than, equal to, or less than another).~~