Fix dots/health track widgets #42
clippy
5 errors, 15 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 5 |
Warning | 15 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.82.0-nightly (fbccf5053 2024-07-27)
- cargo 1.82.0-nightly (5f6b9a922 2024-07-19)
- clippy 0.1.82 (fbccf50 2024-07-27)
Annotations
Check warning on line 621 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:621:7
|
621 | ..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 failure on line 237 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:237:38
|
237 | ... 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
|
237 | shell.publish((self.on_click)(u16::try_from(i)));
| ~~~~~~~~~~~~~~~~
Check failure on line 255 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:255:6
|
255 | 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
= note: `#[deny(clippy::redundant_locals)]` on by default
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 87 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:87:3
|
87 | Arc::new(DefaultLocalizer::new(&*LANGUAGE_LOADER, &Localizations));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 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 70 in src/widget/track.rs
github-actions / clippy
unused variable: `renderer`
warning: unused variable: `renderer`
--> src/widget/track.rs:70:3
|
70 | renderer: &Renderer,
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_renderer`
Check warning on line 69 in src/widget/track.rs
github-actions / clippy
unused variable: `tree`
warning: unused variable: `tree`
--> src/widget/track.rs:69:3
|
69 | tree: &mut widget::Tree,
| ^^^^ help: if this is intentional, prefix it with an underscore: `_tree`
|
= note: `#[warn(unused_variables)]` on by default
Check warning on line 8 in src/widget/track.rs
github-actions / clippy
unused import: `Alignment`
warning: unused import: `Alignment`
--> src/widget/track.rs:8:19
|
8 | use iced::{mouse, Alignment, Border, Color, Element, Length, Rectangle, Size};
| ^^^^^^^^^
Check warning on line 6 in src/widget/track.rs
github-actions / clippy
unused imports: `Column` and `Row`
warning: unused imports: `Column` and `Row`
--> src/widget/track.rs:6:26
|
6 | use iced::widget::{text, Column, Row};
| ^^^^^^ ^^^
Check warning on line 9 in src/widget/dots.rs
github-actions / clippy
unused import: `Alignment`
warning: unused import: `Alignment`
--> src/widget/dots.rs:9:19
|
9 | use iced::{mouse, Alignment, Border, Color, Element, Length, Rectangle, Size};
| ^^^^^^^^^
Check warning on line 8 in src/widget/dots.rs
github-actions / clippy
unused import: `Padding`
warning: unused import: `Padding`
--> src/widget/dots.rs:8:38
|
8 | use iced::{event, touch, Background, Padding, Point, Theme};
| ^^^^^^^
Check warning on line 7 in src/widget/dots.rs
github-actions / clippy
unused imports: `Column` and `Row`
warning: unused imports: `Column` and `Row`
--> src/widget/dots.rs:7:26
|
7 | use iced::widget::{text, Column, Row};
| ^^^^^^ ^^^
Check warning on line 1 in src/widget/dots.rs
github-actions / clippy
unused import: `std::array`
warning: unused import: `std::array`
--> src/widget/dots.rs:1:5
|
1 | use std::array;
| ^^^^^^^^^^
Check failure on line 298 in src/view/splat_extras.rs
github-actions / clippy
binding's name is too similar to existing binding
error: binding's name is too similar to existing binding
--> src/view/splat_extras.rs:298:7
|
298 | let rites = if let Splat::Werewolf(.., data) = &character.splat {
| ^^^^^
|
note: existing binding defined here
--> src/view/splat_extras.rs:149:7
|
149 | let rotes: Element<Self::Event, Theme> = if let Splat::Mage(.., data) = &character.splat {
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#similar_names
note: the lint level is defined here
--> src/main.rs:2:9
|
2 | #![deny(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::similar_names)]` implied by `#[deny(clippy::pedantic)]`
Check warning on line 17 in src/main.rs
github-actions / clippy
unused import: `Size`
warning: unused import: `Size`
--> src/main.rs:17:62
|
17 | Alignment, Application, Command, Element, Length, Settings, Size, Theme,
| ^^^^
|
= note: `#[warn(unused_imports)]` on by default