Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


No macros needed!

    use std::cmp::min;
    min(a, b);
https://doc.rust-lang.org/std/cmp/fn.min.html


Ha. I should have known, thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: