News for hackers. Stuff that matters.
Re:Statements vs. Expressions by remkop22 on Thursday July 14, 2022 @07:37AM (#32094595)
Rust actually accomplishes this with the unit '()' type which is similar but not the same as void in other languages. Any statement (or expression) produces a value, sometimes that value is just a unit, which can be passed around just as any other value. Currently the exception to this are 'let' statements but there is a nightly feature where this produces a unit value as well.

There are no comments on this comment yet.