4 ms·
That would this in rust: if number { true } else { false } If it's the last expression it will implicitly return the values. Easily fits on one line.
by staticassertion 10y ago
That would this in rust:
if number { true } else { false }
If it's the last expression it will implicitly return the values. Easily fits on one line.
- twic 10y agoMy one puny objection to this is that rustfmt won't put the arms on a single line, but will always break and indent around the blocks. That makes Rust's expression-if considerably more verbose than what Perl has, or even the ternary operator.
- staticassertion 10y agoHm. I wonder if this is configurable, or if there's an RFC open for this.
- deleted 10y ago[deleted]