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

Clippy fixes. #441

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Clippy fixes. #441

merged 1 commit into from
Mar 5, 2024

Conversation

ltratt
Copy link
Member

@ltratt ltratt commented Mar 5, 2024

No description provided.

@ratmice ratmice added this pull request to the merge queue Mar 5, 2024
Merged via the queue into softdevteam:master with commit b5abf08 Mar 5, 2024
2 checks passed
@ratmice
Copy link
Collaborator

ratmice commented Mar 5, 2024

Been a bit enamored with the cargo hack tool lately, so ran this through cargo hack --feature-powerset, which came back relatively clean.

It did produce one warning with cargo clippy --no-default-features -p lrtable

info: running `cargo clippy --no-default-features` on lrtable (11/20)
warning: field `final_state` is never read
   --> lrtable/src/lib/statetable.rs:144:5
    |
133 | pub struct StateTable<StorageT> {
    |            ---------- field in this struct
...
144 |     final_state: StIdx<StorageT>,
    |     ^^^^^^^^^^^
    |
    = note: `#[warn(dead_code)]` on by default

I think that field being unread looks real, but is perhaps being suppressed by reads from the serde feature?

@ltratt
Copy link
Member Author

ltratt commented Mar 5, 2024

I think that field being unread looks real, but is perhaps being suppressed by reads from the serde feature?

Ah, yes, maybe! Shall we try removing it and see if it goes through CI?

@ratmice
Copy link
Collaborator

ratmice commented Mar 5, 2024

It does actually look like it gets used in one test, but clippy can't see that because of conditional compilation of the test module.

assert_eq!(st.final_state, s1);

It seems reasonable to want to keep testing that, I'm not sure how I feel about
adding the field conditionally during testing, any thoughts?

+   #[cfg(test)]
     final_state: StIdx<StorageT>,
+            #[cfg(test)]
             final_state: final_state.unwrap(),

@ltratt
Copy link
Member Author

ltratt commented Mar 5, 2024

I'm very fine with that sort of conditional testing if you want to raise a PR for it!

@ltratt ltratt deleted the clippy_fixes branch March 5, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants