Closed cgzones closed 8 months ago
If there is a specific method you think could be reasonably interpreted as mutating the input that does not already have a #[must_use]
attribute, please open an issue to discuss it. Adding it to everything is functionally pointless.
Is it though? For example std::time::Duration uses the annotation on almost every interface (except for ones returning Result, since Result already comes with an annotation).
And I disagree with using it that much. As I said, a method needs to be able to be reasonably interpreted as mutating the input. That is the criteria that I am using. Anything else is a non-starter.
Annotate several public funtions that either don't modify their original value or only compute a value, except for ones returning
Result
.Avoid no-op code such as: