3 ms·
>This is the Rust idiom for “I am intentionally ignoring this return value”. That doesn't make the code any less awful, it just makes idiomatic Rust sound awfu
by logicchains 3mo ago
>This is the Rust idiom for “I am intentionally ignoring this return value”.
That doesn't make the code any less awful, it just makes idiomatic Rust sound awful. Discarding a return value without even a comment to explain why shouldn't be allowed in any critical project, and the linter should be perfectly capable of ensuring that a comment accompanies the discard and complaining loudly when it doesn't.
- dwroberts 3mo agoThis is missing that it’s a human issue though. If someone is determined to discard an error and not do anything about it, they’ll just put in a dummy comment to appease the linter any way. Force people to handle errors and you end up with the exception fiasco in eg Java where everything ends up being a runtime exception to avoid it
- throw_await 3mo agoAs the top comment states, there is a lint rule, but you have to turn it on.