

Two commutes with Rust - n_ham
http://xania.org/201505/two-commutes-with-rust

======
maguirre
_There’s no ternary operators, but instead everything is an expression, so you
just put an if statement in the middle of your expression like : a = if b > 1
{ 1 } else { 2 }._

I don't understand this takeaway. Did the author forget a word?

~~~
readams
a = if b > 1 { 1 } else { 2 }

is equivalent to:

a = b > 1 ? 1 : 2

in other languages. Meaning that the if/else statement can be used as an
expression that can provide an rvalue of integer type.

