Warning: Some posts on this platform may contain adult material intended for mature audiences only. Viewer discretion is advised. By clicking ‘Continue’, you confirm that you are 18 years or older and consent to viewing explicit content.
I’m guessing you’re asking because you got a clippy lint. Using Ordering allows you to match the output therefore only calling partial_ord once, compared to using an if-else chain which might call it several times. In many/most cases this would probably be compiler optimized anyway but this makes it explicit.
I’m guessing you’re asking because you got a clippy lint. Using
Ordering
allows you tomatch
the output therefore only callingpartial_ord
once, compared to using an if-else chain which might call it several times. In many/most cases this would probably be compiler optimized anyway but this makes it explicit.