const-gen
const-gen copied to clipboard
Generated code triggers clippy::redundant-static-lifetimes warning
When using const_declaration! on Vec<u8>, the generated is made of const XXX: &'static [u8] lines, which triggers the clippy::redundant-static-lifetimes clippy lint.
I worked around this by stuffing #[allow(clippy::redundant_static_lifetimes)] lines in the generated code, but it is probably better to fix this at the source.
Thank you
Fixed in 1.6.3
Reopened due to https://github.com/Eolu/const-gen/issues/13
1.6.4 reverts this change. This will require more work than anticipated.
Faced the same issue.
For future readers, here's what I came up with:
let const_declarations = [
...
]
.map(|s| "#[allow(clippy::redundant_static_lifetimes)]\n".to_string() + s.as_str())
.join("\n\n");