Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
masklinn
on Nov 10, 2016
|
parent
|
context
|
favorite
| on:
Announcing Rust 1.13
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
on Nov 10, 2016
[–]
No macros needed!
use std::cmp::min; min(a, b);
https://doc.rust-lang.org/std/cmp/fn.min.html
masklinn
on Nov 11, 2016
|
parent
[–]
Ha. I should have known, thanks.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: