clippy: Allow redundant_clone in generated rust code

This disabled about 70 clippy warnings like this one:

```
warning: redundant clone
     --> target\debug\build\energy-monitor-7b0492feb1633656\out\desktop_window.rs:44279:37
      |
44279 |                      (if (((r#state . clone ()) . r#previous_state as f64) == (1f64 as f64)) {
      |                                     ^^^^^^^^^^^ help: remove this
      |
note: cloned value is neither consumed nor mutated
     --> target\debug\build\energy-monitor-7b0492feb1633656\out\desktop_window.rs:44279:28
      |
44279 |                      (if (((r#state . clone ()) . r#previous_state as f64) == (1f64 as f64)) {
      |                            ^^^^^^^^^^^^^^^^^^^^
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
```
This commit is contained in:
Tobias Hunger 2023-03-09 11:05:44 +01:00 committed by Tobias Hunger
parent d1aaba8117
commit 3d87b3ab93

View file

@ -303,6 +303,8 @@ pub fn generate(doc: &Document) -> TokenStream {
#[allow(clippy::approx_constant)] // We may get those from .slint inputs!
#[allow(clippy::eq_op)] // The generated code will compare/subtract/etc. equal values
#[allow(clippy::cmp_owned)] // The generated code will do this
#[allow(clippy::redundant_clone)] // TODO: We clone properties more often then needed
// according to clippy!
mod #compo_module {
use slint::private_unstable_api::re_exports::*;
#(#structs)*