-
Notifications
You must be signed in to change notification settings - Fork 153
mesh_protobuf: fix clippy errors when used in no_std #2060
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds proper feature gating for the TimestampOutOfRange
error type in the mesh_protobuf crate's time module. The change prevents clippy warnings about unused fields by ensuring the error type is only compiled when the "std" feature is enabled, where it's actually used.
- Gates the
TimestampOutOfRange
error behind the "std" feature flag
hmm not quite complete, need to iterate a bit more... |
annotation: &'a str, | ||
} | ||
|
||
#[cfg_attr(not(feature = "std"), allow(dead_code))] |
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.
expect instead of allow?
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.
does that work if not all the fields are unused? it's only a few at the bottom.
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.
Yes, as long as the lint happens once
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.
sure lemme flip em then...
There's a few fields that need to be gated, along with allowing dead code. Otherwise, clippy will complain about a bunch of unused fields.