Is it possible to put #[allow(non_snake_case)]
on individual fields?
pub struct Foo {
#[allow(non_snake_case)]
pub x____y____z: u8,
}
Despite the #[allow]
, this still generates a warning:
warning: structure field `x____y____z` should have a snake case name
--> src/lib.rs:3:9
|
3 | pub x____y____z: u8,
| ^^^^^^^^^^^ help: convert the identifier to snake case: `x_y_z`
|
= note: `#[warn(non_snake_case)]` on by default
My use case is that I have a macro that adds hidden bookkeeping fields to a struct. Sometimes the fields have multiple underscores in a row. I'd like to be able to disable the snake-case check for the hidden fields but not do it for the struct as a whole.