3 ms·
But…. these are two completely different statements, the equivalent Rust is if a < b { b } else { a } why are you adding sprurious returns? And if you nee
by masklinn 10y ago
But…. these are two completely different statements, the equivalent Rust is
if a < b { b } else { a }
why are you adding sprurious returns? And if you need to get the minimum of two values so much that actually impacts you, write a `min!` macro?
- shepmaster 10y agoNo macros needed! use std::cmp::min; min(a, b); https://doc.rust-lang.org/std/cmp/fn.min.html https://doc.rust-lang.org/std/cmp/fn.min.html
- masklinn 10y agoHa. I should have known, thanks.