3 ms·
Why are Rust developers so pedantic with this stuff. What the author wrote is perfectly valid, fine code. Please stop insisting everyone does something one way
by brabel 5y ago
Why are Rust developers so pedantic with this stuff.
What the author wrote is perfectly valid, fine code. Please stop insisting everyone does something one way or another when there's no clear advantage here to doing so except for the lack of single bloody keyword.
- vlmutolo 5y agoIt's "perfectly valid, fine" with the exception that it's different from how the vast majority of Rust programmers write code. That in itself is a problem. Rust has two widely-used tools that enforce style: `rustfmt` and `clippy`. The former enforces formatting style and the latter general programming style, such as whether or not to use a `return` statement (`clippy` also does non-style lints). For many of these formatting/stylistic lints, there are valid arguments to be made for an alternative choice. I personally often disagree with one or both tools. I still follow them. The huge benefit here is that most Rust codebases look identical. I can open up burntsushi's regex crate and see code that is formatted and styled exactly like mine. It makes reading new code a lot easier.