Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unecessary #[must_use] #89

Closed
jorickert opened this issue Sep 3, 2019 · 1 comment
Closed

Unecessary #[must_use] #89

jorickert opened this issue Sep 3, 2019 · 1 comment
Labels
question Further information is requested

Comments

@jorickert
Copy link
Contributor

Many functions that return a Result are tagged with #[must_use].
This seems unnecessary, because Result itself is already tagged with it https://doc.rust-lang.org/std/result/#results-must-be-used

@brycx
Copy link
Member

brycx commented Sep 3, 2019

Thank you for pointing this out. The reason #[must_use] on Result is still in the code-base is, that I thought about adding an explicit security-warning to these. Such that a user is warned that ignoring results may have a negative effect on security. But, as you can see, I haven't gotten any further with the idea.

I have opened an issue where this can be discussed further, but until anything has been decided there is no reason for #[must_use] on Result. If you have any opinions on adding security-warnings, please feel free to share them in the linked issue. Otherwise, if you want, I'd gladly welcome a PR to remove the #[must_use] until next steps have been decided. Or you could wait a bit, in case the decision is quickly made and then add the security-warnings.

@brycx brycx added the question Further information is requested label Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants