mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
clippy: Allow eq_op
in generated rust code
I get the following clippy errors in the energy monitor: error: equal expressions as operands to `-` --> C:\src\slint\target\debug\build\energy-monitor-7b0492feb1633656\out\desktop_window.rs:47254:94 | 47254 | ... (slint :: private_unstable_api :: re_exports :: LogicalLength :: new (((((0f64 as f64) - (0f64 as f64)) as f64) * (((1f64 as f64) *... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#eq_op error: equal expressions as operands to `==` --> C:\src\slint\target\debug\build\energy-monitor-7b0492feb1633656\out\desktop_window.rs:45382:18 | 45382 | (((0f64 as f64) == (0f64 as f64))) as bool } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#eq_op I am not surprised that the generated code sometimes produces code like this (even though the other demos do not!), so I went ahead and silenced these errors.
This commit is contained in:
parent
233bc61c8e
commit
7c19cde055
1 changed files with 1 additions and 0 deletions
|
@ -301,6 +301,7 @@ pub fn generate(doc: &Document) -> TokenStream {
|
|||
#[allow(unused_braces)]
|
||||
#[allow(clippy::erasing_op)]
|
||||
#[allow(clippy::approx_constant)] // We may get those from .slint inputs!
|
||||
#[allow(clippy::eq_op)] // The generated code will compare/subtract/etc. equal values
|
||||
mod #compo_module {
|
||||
use slint::private_unstable_api::re_exports::*;
|
||||
#(#structs)*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue