You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clippy will warn against unused code (the numeric fields of the NumberType enum), even though they are printed in the show function.
warning: field `0` is never read
--> exercises/09_ambiguity_and_ordering/main.rs:10:20
|
10 | PositiveNumber(u32),
| -------------- ^^^
| |
| field in this variant
|
= note: `NumberType` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
10 | PositiveNumber(()),
| ~~
I simply put a #[allow(dead_code)] annotation over NumberType to solve this issue.
The text was updated successfully, but these errors were encountered:
Another fantastic exercise, I love this book!
Clippy will warn against unused code (the numeric fields of the
NumberType
enum), even though they are printed in the show function.I simply put a
#[allow(dead_code)]
annotation overNumberType
to solve this issue.The text was updated successfully, but these errors were encountered: