Update to latest iced (2/2) #40
clippy
8 errors, 27 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 8 |
Warning | 27 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.82.0-nightly (7c2012d0e 2024-07-26)
- cargo 1.82.0-nightly (5f6b9a922 2024-07-19)
- clippy 0.1.82 (7c2012d 2024-07-26)
Annotations
Check warning on line 619 in src/main.rs
github-actions / clippy
struct update has no effect, all the fields in the struct have already been specified
warning: struct update has no effect, all the fields in the struct have already been specified
--> src/main.rs:619:7
|
619 | ..Default::default()
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
= note: `#[warn(clippy::needless_update)]` on by default
Check warning on line 118 in src/main.rs
github-actions / clippy
using `map` over `inspect`
warning: using `map` over `inspect`
--> src/main.rs:118:5
|
118 | .map(|val| {
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect
= note: `#[warn(clippy::manual_inspect)]` on by default
help: try
|
118 ~ .inspect(|val| {
119 ~ val.calc_mod_map();
|
Check warning on line 151 in src/widget/track.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/widget/track.rs:151:13
|
151 | if let Some(_) = cursor.position_over(layout.bounds()) {
| -------^^^^^^^---------------------------------------- help: try: `if cursor.position_over(layout.bounds()).is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check failure on line 241 in src/widget/dots.rs
github-actions / clippy
casting `usize` to `u16` may truncate the value
error: casting `usize` to `u16` may truncate the value
--> src/widget/dots.rs:241:38
|
241 | ... shell.publish((self.on_click)(i as u16));
| ^^^^^^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: `#[deny(clippy::cast_possible_truncation)]` implied by `#[deny(clippy::pedantic)]`
help: ... or use `try_from` and handle the error accordingly
|
241 | shell.publish((self.on_click)(u16::try_from(i)));
| ~~~~~~~~~~~~~~~~
Check warning on line 233 in src/widget/dots.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/widget/dots.rs:233:13
|
233 | if let Some(_) = cursor.position_over(layout.bounds()) {
| -------^^^^^^^---------------------------------------- help: try: `if cursor.position_over(layout.bounds()).is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
Check warning on line 165 in src/widget/dots.rs
github-actions / clippy
redundant pattern matching, consider using `is_some()`
warning: redundant pattern matching, consider using `is_some()`
--> src/widget/dots.rs:165:11
|
165 | if let Some(_) = cursor.position_over(bounds) {
| -------^^^^^^^------------------------------- help: try: `if cursor.position_over(bounds).is_some()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
Check failure on line 258 in src/view/splat_extras.rs
github-actions / clippy
redundant redefinition of a binding `wolf_gifts`
error: redundant redefinition of a binding `wolf_gifts`
--> src/view/splat_extras.rs:258:6
|
258 | let wolf_gifts = wolf_gifts;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: `wolf_gifts` is initially defined here
--> src/view/splat_extras.rs:227:8
|
227 | let wolf_gifts: Vec<Translated<WolfGift>> = WolfGift::all()
| ^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals
Check failure on line 239 in src/view/splat_extras.rs
github-actions / clippy
redundant redefinition of a binding `shadow_gifts`
error: redundant redefinition of a binding `shadow_gifts`
--> src/view/splat_extras.rs:239:6
|
239 | let shadow_gifts = shadow_gifts;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: `shadow_gifts` is initially defined here
--> src/view/splat_extras.rs:222:8
|
222 | let shadow_gifts: Vec<Translated<ShadowGift>> = ShadowGift::all()
| ^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals
Check warning on line 510 in src/view/overview.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/view/overview.rs:506:37
|
506 | let (passive, common, specific): (
| ______________________________________________^
507 | | Element<Self::Event, Theme>,
508 | | Element<Self::Event, Theme>,
509 | | Element<Self::Event, Theme>,
510 | | ) = if let KuruthTriggers::_Custom(KuruthTriggerSet {
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
Check failure on line 276 in src/view/overview.rs
github-actions / clippy
casting `u16` to `i16` may wrap around the value
error: casting `u16` to `i16` may wrap around the value
--> src/view/overview.rs:276:29
|
276 | character.base_size = (val as i16 - character.get_modifier(Trait::Size)) as u16;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
= note: `#[deny(clippy::cast_possible_wrap)]` implied by `#[deny(clippy::pedantic)]`
Check failure on line 276 in src/view/overview.rs
github-actions / clippy
casting `i16` to `u16` may lose the sign of the value
error: casting `i16` to `u16` may lose the sign of the value
--> src/view/overview.rs:276:28
|
276 | character.base_size = (val as i16 - character.get_modifier(Trait::Size)) as u16;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
= note: `#[deny(clippy::cast_sign_loss)]` implied by `#[deny(clippy::pedantic)]`
Check warning on line 26 in src/view/creator.rs
github-actions / clippy
large size difference between variants
warning: large size difference between variants
--> src/view/creator.rs:23:1
|
23 | / pub enum Event {
24 | | SplatChanged(Splat), // TODO: Switch to using a unit-varianted "SplatKind" enum here
| | ------------------- the largest variant contains at least 208 bytes
25 | | Done,
| | ---- the second-largest variant carries no data at all
26 | | }
| |_^ the entire enum is at least 208 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
|
24 | SplatChanged(Box<Splat>), // TODO: Switch to using a unit-varianted "SplatKind" enum here
| ~~~~~~~~~~
Check warning on line 86 in src/i18n.rs
github-actions / clippy
usage of an `Arc` that is not `Send` and `Sync`
warning: usage of an `Arc` that is not `Send` and `Sync`
--> src/i18n.rs:86:42
|
86 | let localizer_arc: Arc<dyn Localizer> = Arc::new(localizer);
| ^^^^^^^^^^^^^^^^^^^
|
= note: `Arc<DefaultLocalizer<'_>>` is not `Send` and `Sync` as `DefaultLocalizer<'_>` is neither `Send` nor `Sync`
= help: if the `Arc` will not used be across threads replace it with an `Rc`
= help: otherwise make `DefaultLocalizer<'_>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
= note: `#[warn(clippy::arc_with_non_send_sync)]` on by default
Check failure on line 126 in src/component/skills.rs
github-actions / clippy
unnecessary boolean `not` operation
error: unnecessary boolean `not` operation
--> src/component/skills.rs:122:6
|
122 | / if !specialties.is_empty() {
123 | | theme::Text::Color(Color::from_rgb(0.0, 0.7, 0.0))
124 | | } else {
125 | | theme::Text::Default
126 | | },
| |_____________________^
|
= help: remove the `!` and swap the blocks of the `if`/`else`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: `#[deny(clippy::if_not_else)]` implied by `#[deny(clippy::pedantic)]`
Check failure on line 104 in src/component/skills.rs
github-actions / clippy
redundant redefinition of a binding `skill`
error: redundant redefinition of a binding `skill`
--> src/component/skills.rs:104:8
|
104 | ... let skill = skill;
| ^^^^^^^^^^^^^^^^^^
|
help: `skill` is initially defined here
--> src/component/skills.rs:93:7
|
93 | for skill in Skill::get(cat) {
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals
= note: `#[deny(clippy::redundant_locals)]` on by default
Check warning on line 46 in src/component/skills.rs
github-actions / clippy
all variants have the same postfix: `Changed`
warning: all variants have the same postfix: `Changed`
--> src/component/skills.rs:41:1
|
41 | / pub enum Event {
42 | | SkillChanged(u16, Skill),
43 | | RoteSkillChanged(Skill),
44 | | SpecialtyChanged(Skill, usize, String),
45 | | SpecialtySkillChanged(Skill),
46 | | }
| |_^
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
= note: `#[warn(clippy::enum_variant_names)]` on by default
Check warning on line 64 in src/component/integrity.rs
github-actions / clippy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/component/integrity.rs:56:37
|
56 | Event::IntegrityDamage(wound) => match &mut character.splat {
| ______________________________________________^
57 | | Splat::Changeling(.., data) => {
58 | | data.clarity.poke(&wound);
59 | | if let Wound::Lethal = wound {
... |
63 | | _ => {}
64 | | },
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
56 ~ Event::IntegrityDamage(wound) => if let Splat::Changeling(.., data) = &mut character.splat {
57 ~ data.clarity.poke(&wound);
58 ~ if let Wound::Lethal = wound {
59 ~ data.clarity.poke(&Wound::Aggravated);
60 ~ }
61 ~ },
|
Check warning on line 35 in src/view/equipment.rs
github-actions / clippy
method `abilities` is never used
warning: method `abilities` is never used
--> src/view/equipment.rs:35:5
|
27 | impl<Message> EquipmentTab<Message> {
| ----------------------------------- method in this implementation
...
35 | fn abilities(&self, _character: &Character) -> Element<Event> {
| ^^^^^^^^^
Check warning on line 83 in src/main.rs
github-actions / clippy
variant `Msg` is never constructed
warning: variant `Msg` is never constructed
--> src/main.rs:83:2
|
77 | enum Message {
| ------- variant in this enum
...
83 | Msg,
| ^^^
|
= note: `Message` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
Check warning on line 107 in src/widget/track.rs
github-actions / clippy
unused variable: `cursor`
warning: unused variable: `cursor`
--> src/widget/track.rs:107:3
|
107 | cursor: mouse::Cursor,
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_cursor`
|
= note: `#[warn(unused_variables)]` on by default
Check warning on line 11 in src/widget/track.rs
github-actions / clippy
unused import: `iced::border::Radius`
warning: unused import: `iced::border::Radius`
--> src/widget/track.rs:11:5
|
11 | use iced::border::Radius;
| ^^^^^^^^^^^^^^^^^^^^
Check warning on line 11 in src/view/mod.rs
github-actions / clippy
unused import: `SplatExtrasTab`
warning: unused import: `SplatExtrasTab`
--> src/view/mod.rs:11:42
|
11 | pub use splat_extras::{splat_extras_tab, SplatExtrasTab};
| ^^^^^^^^^^^^^^
Check warning on line 10 in src/view/mod.rs
github-actions / clippy
unused import: `OverviewTab`
warning: unused import: `OverviewTab`
--> src/view/mod.rs:10:34
|
10 | pub use overview::{overview_tab, OverviewTab};
| ^^^^^^^^^^^
Check warning on line 9 in src/view/mod.rs
github-actions / clippy
unused import: `EquipmentTab`
warning: unused import: `EquipmentTab`
--> src/view/mod.rs:9:36
|
9 | pub use equipment::{equipment_tab, EquipmentTab};
| ^^^^^^^^^^^^
Check warning on line 8 in src/view/mod.rs
github-actions / clippy
unused import: `CreatorView`
warning: unused import: `CreatorView`
--> src/view/mod.rs:8:33
|
8 | pub use creator::{creator_view, CreatorView};
| ^^^^^^^^^^^