Basically, cmp::Ordering::Less
is an enum so a match using it is guaranteed to be exhaustive, whereas you need to be careful when doing an if/else chain that you cover all cases.
this post was submitted on 07 Jan 2024
13 points (100.0% liked)
Rust
5938 readers
4 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS