mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
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:
parent
d1aaba8117
commit
3d87b3ab93
1 changed files with 2 additions and 0 deletions
|
@ -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)*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue