antoyo / relm

Idiomatic, GTK+-based, GUI library, inspired by Elm, written in Rust
MIT License
2.43k stars 78 forks source link

relm-derive macro generate codes that cargo clippy flags #238

Closed emmanueltouzery closed 4 years ago

emmanueltouzery commented 4 years ago

recent cargo clippy has started to flag code generated by the relm-derive macro. I think the error is self-explanatory:

warning: redundant field names in struct initialization
   --> src/widgets/wintitlebar.rs:263:20
    |
263 |             #[name="main_window_stack_switcher"]
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `main_window_stack_switcher`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_name

The lint is https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_name

It's about field puning:

let foo = Foo { bar: bar };
// should be
let foo = Foo { bar };

I guess relm-derive could either generate code that clippy likes, or worst-case generate locally for that code an ignore annotation for clippy.

antoyo commented 4 years ago

Yeah, there's a PR #234 already to workaround this. I haven't had the time to look at that yet. I look at it soon.