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

Remove warnings in generated code #68

Merged
merged 4 commits into from
May 7, 2024

Conversation

projectgus
Copy link
Contributor

Thanks for creating this project, it's exactly what I was looking for!

This PR is a small collection of individual commits to remove warnings in the generated Rust code. It shouldn't change any actual functionality:

  • Disable unused imports warnings (fixes Compile warnings unused and redundant imports #53)
  • Avoid warnings in code generated for messages that contain no signals (not common, but possible especially when reverse engineering.)
  • Add a config option for #!allow(dead_code) in the generated source file, useful if you're generating from a large DBC file but don't intend to use all of it in your project.
  • Disable the clippy too_many_arguments warning. Constructors for messages with a lot of signals are impractical, but hard to see an easy way to introduce an alternative constructor.

projectgus added 4 commits May 6, 2024 11:53
Quiets warnings like "warning: unused import: `core::ops::BitOr`" depending
on DBC contents.
…als.

Uncommon, but can happen (for example during reverse engineering).
Prevents dead code warnings if only a small part of the entire
generated Rust module is used.
Copy link
Member

@killercup killercup left a comment

Choose a reason for hiding this comment

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

Thanks!

@killercup killercup merged commit 1054804 into technocreatives:main May 7, 2024
2 checks passed
@projectgus projectgus deleted the tweaks/codegen_warnings branch May 7, 2024 22:22
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.

Compile warnings unused and redundant imports
2 participants