Hacker News new | ask | show | jobs
by grg0 25 days ago
It's the latter; Rust won't allow the int->bool coercion.

Though to be absolutely pedantic, !x is an int for x:int in C, there is no bool coercion involved; an if-statement takes an expression of any scalar value and evals to true on non-zero. Not that that helps to avoid introducing bugs anyway.