-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
Description
I was changing some code from integer constants to a proper enum and was greeted by the following warning:
Compiling script v0.0.1 (file:///Users/nox/src/servo/components/script)
warning: variant is never used: `HaveMetadata`
--> /Users/nox/src/servo/components/script/dom/htmlmediaelement.rs:88:5
|
88 | HaveMetadata = HTMLMediaElementConstants::HAVE_METADATA as u8,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
The warning sounded weird to me because I was pattern-matching on that damn variant in various places of the code; but I was pointed out to the fact that I wasn't actually creating that value.
Maybe the warning should be rewritten to explicitly mention value creation?
Cc @arielb1
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.