Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
post-it
· 5y ago · 0 comments
In Rust, a block that ends with an expression without a semicolon returns that expression. It lets you write terse things like
let x = if y { a } else { b }
Comments
[–]
NoSorryCannot
5y ago
Kotlin does the same but without semicolons so it would seem not to be essential.