Closed l-7-l closed 1 year ago
#[derive( Debug, Clone, Copy, Serialize_repr, Deserialize_repr, IntoPrimitive, FromPrimitive, )] #[repr(i16)] pub enum MediaKind { #[default] Image = 0, // warning: Constant `Image__num_enum_0__` should have UPPER_SNAKE_CASE name, e.g. `IMAGE_NUM_ENUM_0`rust-analyzer[non_upper_case_globals](https://doc.rust-lang.org/rustc/?search%3Dnon_upper_case_globals) Video = 1, // warning: Constant `Video__num_enum_0__` should have UPPER_SNAKE_CASE name, e.g. `VIDEO_NUM_ENUM_0`rust-analyzer[non_upper_case_globals](https://doc.rust-lang.org/rustc/?search%3Dnon_upper_case_globals) Audio = 2, // warning: Constant `Audio__num_enum_0__` should have UPPER_SNAKE_CASE name, e.g. `AUDIO_NUM_ENUM_0`rust-analyzer[non_upper_case_globals](https://doc.rust-lang.org/rustc/?search%3Dnon_upper_case_globals) } impl MediaKind { pub fn as_i16(&self) -> i16 { (*self).into() } }
num_enum = "0.7.0"
rustc -V rustc 1.73.0-nightly (d06ca0ffa 2023-08-18)
cargo clippy -V clippy 0.1.73 (d06ca0f 2023-08-18)
I'm having this issue now. Is it fixed in an upcoming version?
@tech6hutch It doesn't seem to be fixed yet. rust-analyzer#6541
Oh okay, so it's not a num_enum issue, it's a rust-analyzer issue. I see there are no warnings when I run cargo check.
cargo check
@tech6hutch It looks like so.
num_enum = "0.7.0"
rustc -V rustc 1.73.0-nightly (d06ca0ffa 2023-08-18)
cargo clippy -V clippy 0.1.73 (d06ca0f 2023-08-18)