4 ms·
> In Rust, omitting a semicolon has a special meaning, ie a return from an expression. So, you can't just ditch it. Of course you could, because a semicolon-le
by ReleaseCandidat 5y ago
> In Rust, omitting a semicolon has a special meaning, ie a return from an expression. So, you can't just ditch it.
Of course you could, because a semicolon-less return doesn't work in the middle of a statement.
You can't do
bla;
a
bla bla;
b
instead of
bla;
return a;
bla bla;
b
Yes, the code after the `return` isn't reachable and the Rust compiler doesn't like that ;)
- wizzwizz4 5y agoBut that would mean {123 456} + {789} was 1245 instead of 124_245.