News for hackers. Stuff that matters.
Re:Rust Language Cheat Sheet by posixplz on Monday August 05, 2019 @09:34AM (#20614032)
You’re correct. Other folks seem to be using non-Rust mental models for semicolons.
Re:Rust Language Cheat Sheet by masklinn on Monday August 05, 2019 @10:13AM (#20614359)
No they're not, see steve's explanation above.

Putting a semicolon after an expression makes it into a statement, which are unit-valued, which is why the expression's value gets suppressed. It's a subset of "statements not ending with blocks" (since an expression-statement doesn't take a statement-block even if the expression itself has one).

Re:Rust Language Cheat Sheet by asdkhadsj on Monday August 05, 2019 @10:51AM (#20614639)
But my comment was in reply to:

> no semicolons after things that use {}, semicolons after everything else.

Which seems fundamentally flawed for a cheatsheet. Unless you never intend to return anything with a bracket, I guess.