Skip to content

Suppress suspicious_else_formatting lint in generated code #303

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

pv42
Copy link
Contributor

@pv42 pv42 commented May 6, 2025

Suppress clippy warning about if statements that looks like it should be else if in the generated code (suspicious_else_formatting) like bellow:

warning: this looks like an `else if` but the `else` is missing
 --> /home/user/Documents/folder/rust-mavlink/target/debug/build/mavlink-701ae44e620db1b6/out/all.rs:1:261081
  |
1 | ...mall (need {} bytes, but got {})" , Self :: ENCODED_LEN , __tmp . remaining () ,) } if matches ! (version , MavlinkVersion :: V2) { let len = __tmp . len () ; :: mavli...
  |                                                                                       ^
  |
  = note: to remove this lint, add the missing `else` or add a new line before the second `if`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting

Note that the warning only appears when used without the format-generated-code feature.

@patrickelectric patrickelectric merged commit fea159c into mavlink:master May 6, 2025
41 checks passed
@pv42 pv42 deleted the supress_sus_else_fmt branch May 27, 2025 22:13
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.

None yet

2 participants