Allow one particular enum to have bad naming conventions

  1. I want an enum of the form:
pub enum Foo {
  math_a, math_b, ..., math_A, math_B, ...,
  main_a, main_b, ..., main_A, main_B, ...,
  cal_A, cal_B, ...
}
  1. The above is terrible enum naming convention but also literally what I want. Is there a way to tell Rust “for this particular enum, let me do as I wish” ?
#[allow(non_camel_case_types)]
pub enum Foo {
  math_a, math_b, ..., math_A, math_B, ...,
  main_a, main_b, ..., main_A, main_B, ...,
  cal_A, cal_B, ...
}

The allow attribute applies to the item and descendants you apply it to, so this would only affect this one enum.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.