-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for reading properties in FDT #4
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
Conversation
|
|
||
| impl<'a> FdtProperty<'a> { | ||
| /// Returns the name of this property. | ||
| #[must_use] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this (and value) must_use? It would be pointless to call it and ignore the return value, sure, but it's not like you're failing to check for an error condition or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the usage of #[must_use] used to be very inconsistent in the Rust ecosystem and has been a topic of discussion for quite a long time. The reference, however, doesn't specify when exactly should the attribute be used.
Nowadays, it seems like the Rust standard library follows something in the lines of "if the function has no side-effects, it should warn when the result is discarded". A while ago over 800 attributes have been added, and you can see that methods such as str::len, or f32::is_nan (or honestly, many many others) do have the attribute. Hence I'm following this to be consistent with the standard library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, fair enough.
No description provided.