News for hackers. Stuff that matters.
Re:Two commutes with Rust by maguirre on Thursday May 21, 2015 @04:41PM (#9585256)
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?

Re:Two commutes with Rust by readams on Thursday May 21, 2015 @06:30PM (#9585762)
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.

Re:Two commutes with Rust by saurik on Friday May 22, 2015 @03:04AM (#9586889)
I think "but" is just incorrect to include: "; instead,". And "there's" should be "there are".