frozenlib / parse-display

Procedural macro to implement Display and FromStr using common settings.
Apache License 2.0
182 stars 14 forks source link

Deriving Display on an enum triggers clippy::pattern_type_mismatch #8

Closed jsim2010 closed 3 years ago

jsim2010 commented 3 years ago

Running clippy on the following code:

#![deny(clippy::pattern_type_mismatch)]

#[derive(parse_display::Display)]
#[display(style = "CamelCase")]
enum Test {
    First,
    Second,
}

results in the following error

error: type of pattern does not match the expression type
   |
   |   enum Test {
   |  ______^
   | |     First,
   | |_________^
   |
   = help: use `*` to dereference the match expression or explicitly match against a `&_` pattern and adjust the enclosed variable bindings
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
frozenlib commented 3 years ago

Thanks!

This issue was fixed in ef1f463398302731c905c91201f003fb0fdf503c.

jsim2010 commented 3 years ago

Awesome! Thank you for the quick response.