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

Fix (clippy) warnings in Rust generated code #230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

boxdot
Copy link
Collaborator

@boxdot boxdot commented Aug 21, 2022

Also fix (clippy) warnings in Rust tests

Tested against rustc version 1.63.0. After this is merged and the new
generator is released, additional flag --all-targets can be added to
cargo test in CI.

Also fix (clippy) warnings in Rust tests

Tested against rustc version 1.63.0. After this is merged and the new
generator is released, additional flag `--all-targets` can be added to
`cargo test` in CI.

Signed-off-by: boxdot <[email protected]>
@boxdot boxdot changed the title Fix (clippy) warnings in Rust generate code Fix (clippy) warnings in Rust generated code Aug 21, 2022
@@ -109,15 +109,13 @@ impl ::std::fmt::Debug for {{archive.name}} {
}

impl {{archive.name}} {
#[allow(unused_imports, unused_variables)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit less granular, though, isn't it?

What's the problem with annotating exactly the imports/variable that might be unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did not work in the first place:

683 |         #[allow(unused_variables)]
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(unused_var

There is no way to annotated a single import as maybe being unused.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But annotating a single variable is possible, should we do that?

@VeaaC
Copy link
Collaborator

VeaaC commented Oct 24, 2022

@boxdot btw, what's up with this one?

@boxdot
Copy link
Collaborator Author

boxdot commented Oct 24, 2022

@boxdot btw, what's up with this one?

Technically, I am still waiting on you review. The only one comment left, where we need to decide how to go forward.

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