Revival/refactor #37
Annotations
13 errors and 34 warnings
casting `usize` to `u16` may truncate the value:
src/widget/dots.rs#L215
error: casting `usize` to `u16` may truncate the value
--> src/widget/dots.rs:215:38
|
215 | ... 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
|
215 | shell.publish((self.on_click)(u16::try_from(i)));
| ~~~~~~~~~~~~~~~~
|
redundant redefinition of a binding `wolf_gifts`:
src/view/splat_extras.rs#L254
error: redundant redefinition of a binding `wolf_gifts`
--> src/view/splat_extras.rs:254:6
|
254 | let wolf_gifts = wolf_gifts;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: `wolf_gifts` is initially defined here
--> src/view/splat_extras.rs:225:8
|
225 | 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
|
redundant redefinition of a binding `shadow_gifts`:
src/view/splat_extras.rs#L237
error: redundant redefinition of a binding `shadow_gifts`
--> src/view/splat_extras.rs:237:6
|
237 | let shadow_gifts = shadow_gifts;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: `shadow_gifts` is initially defined here
--> src/view/splat_extras.rs:220:8
|
220 | 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
|
casting `u16` to `i16` may wrap around the value:
src/view/overview.rs#L260
error: casting `u16` to `i16` may wrap around the value
--> src/view/overview.rs:260:29
|
260 | 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)]`
|
casting `i16` to `u16` may lose the sign of the value:
src/view/overview.rs#L260
error: casting `i16` to `u16` may lose the sign of the value
--> src/view/overview.rs:260:28
|
260 | 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)]`
|
unnecessary boolean `not` operation:
src/component/traits.rs#L101
error: unnecessary boolean `not` operation
--> src/component/traits.rs:101:22
|
101 | let alternate_xp = if !self.traits.alt_opt {
| ____________________________^
102 | | row![text(format!(
103 | | "{}: {}",
104 | | flt(&self.traits.splat, Some("experience")).unwrap(),
... |
108 | | row![]
109 | | };
| |_________^
|
= 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
|
unnecessary boolean `not` operation:
src/component/traits.rs#L86
error: unnecessary boolean `not` operation
--> src/component/traits.rs:86:25
|
86 | let alternate_beats = if !self.traits.alt_opt {
| _______________________________^
87 | | row![
88 | | text(format!(
89 | | "{}:",
... |
98 | | row![]
99 | | };
| |_________^
|
= 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
|
unnecessary boolean `not` operation:
src/component/skills.rs#L112
error: unnecessary boolean `not` operation
--> src/component/skills.rs:112:6
|
112 | / if !specialties.is_empty() {
113 | | theme::Text::Color(Color::from_rgb(0.0, 0.7, 0.0))
114 | | } else {
115 | | theme::Text::Default
116 | | },
| |_____________________^
|
= 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)]`
|
redundant redefinition of a binding `skill`:
src/component/skills.rs#L94
error: redundant redefinition of a binding `skill`
--> src/component/skills.rs:94:7
|
94 | let skill = skill;
| ^^^^^^^^^^^^^^^^^^
|
help: `skill` is initially defined here
--> src/component/skills.rs:84:7
|
84 | 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
|
this function has too many lines (120/100):
src/component/integrity.rs#L74
error: this function has too many lines (120/100)
--> src/component/integrity.rs:74:2
|
74 | / fn view(&self, _state: &Self::State) -> Element<Self::Event> {
75 | | let character = self.character.borrow();
76 | |
77 | | let mut col = Column::new()
... |
206 | | col.into()
207 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
= note: `#[deny(clippy::too_many_lines)]` implied by `#[deny(clippy::pedantic)]`
|
binding's name is too similar to existing binding:
src/view/splat_extras.rs#L295
error: binding's name is too similar to existing binding
--> src/view/splat_extras.rs:295:7
|
295 | let rites = if let Splat::Werewolf(.., data) = &character.splat {
| ^^^^^
|
note: existing binding defined here
--> src/view/splat_extras.rs:135:7
|
135 | let rotes: Element<Self::Event> = 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:3:9
|
3 | #![deny(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::similar_names)]` implied by `#[deny(clippy::pedantic)]`
|
check
Clippy had exited with the 101 exit code
|
test
The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
|
struct update has no effect, all the fields in the struct have already been specified:
src/main.rs#L621
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
|
using `map` over `inspect`:
src/main.rs#L121
warning: using `map` over `inspect`
--> src/main.rs:121:5
|
121 | .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
|
121 ~ .inspect(|val| {
122 ~ val.calc_mod_map();
|
|
large size difference between variants:
src/view/creator.rs#L23
warning: large size difference between variants
--> src/view/creator.rs:23:1
|
23 | / pub enum Event {
24 | | SplatChanged(Splat),
| | ------------------- 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>),
| ~~~~~~~~~~
|
usage of an `Arc` that is not `Send` and `Sync`:
src/i18n.rs#L86
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
|
all variants have the same postfix: `Changed`:
src/component/skills.rs#L42
warning: all variants have the same postfix: `Changed`
--> src/component/skills.rs:42:1
|
42 | / pub enum Event {
43 | | SkillChanged(u16, Skill),
44 | | RoteSkillChanged(Skill),
45 | | SpecialtyChanged(Skill, usize, String),
46 | | SpecialtySkillChanged(Skill),
47 | | }
| |_^
|
= 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
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
src/component/integrity.rs#L53
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> src/component/integrity.rs:53:37
|
53 | Event::IntegrityDamage(wound) => match &mut character.splat {
| ______________________________________________^
54 | | Splat::Changeling(.., data) => {
55 | | data.clarity.poke(&wound);
56 | | if let Wound::Lethal = wound {
... |
60 | | _ => {}
61 | | },
| |_____________^
|
= 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
|
53 ~ Event::IntegrityDamage(wound) => if let Splat::Changeling(.., data) = &mut character.splat {
54 ~ data.clarity.poke(&wound);
55 ~ if let Wound::Lethal = wound {
56 ~ data.clarity.poke(&Wound::Aggravated);
57 ~ }
58 ~ },
|
|
method `abilities` is never used:
src/view/equipment.rs#L36
warning: method `abilities` is never used
--> src/view/equipment.rs:36:5
|
28 | impl<Message> EquipmentTab<Message> {
| ----------------------------------- method in this implementation
...
36 | fn abilities(&self, _character: &Character) -> Element<Event> {
| ^^^^^^^^^
|
variant `Msg` is never constructed:
src/main.rs#L86
warning: variant `Msg` is never constructed
--> src/main.rs:86:2
|
80 | enum Message {
| ------- variant in this enum
...
86 | 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
|
the feature `is_some_and` has been stable since 1.70.0 and no longer requires an attribute to enable:
src/main.rs#L1
warning: the feature `is_some_and` has been stable since 1.70.0 and no longer requires an attribute to enable
--> src/main.rs:1:12
|
1 | #![feature(is_some_and)]
| ^^^^^^^^^^^
|
= note: `#[warn(stable_features)]` on by default
|
unused import: `SplatExtrasTab`:
src/view/mod.rs#L11
warning: unused import: `SplatExtrasTab`
--> src/view/mod.rs:11:42
|
11 | pub use splat_extras::{splat_extras_tab, SplatExtrasTab};
| ^^^^^^^^^^^^^^
|
unused import: `OverviewTab`:
src/view/mod.rs#L10
warning: unused import: `OverviewTab`
--> src/view/mod.rs:10:34
|
10 | pub use overview::{overview_tab, OverviewTab};
| ^^^^^^^^^^^
|
unused import: `EquipmentTab`:
src/view/mod.rs#L9
warning: unused import: `EquipmentTab`
--> src/view/mod.rs:9:36
|
9 | pub use equipment::{equipment_tab, EquipmentTab};
| ^^^^^^^^^^^^
|
unused import: `CreatorView`:
src/view/mod.rs#L8
warning: unused import: `CreatorView`
--> src/view/mod.rs:8:33
|
8 | pub use creator::{creator_view, CreatorView};
| ^^^^^^^^^^^
|
unused import: `CharacterList`:
src/view/mod.rs#L7
warning: unused import: `CharacterList`
--> src/view/mod.rs:7:42
|
7 | pub use character_list::{character_list, CharacterList};
| ^^^^^^^^^^^^^
|
unused import: `TraitsComponent`:
src/component/mod.rs#L17
warning: unused import: `TraitsComponent`
--> src/component/mod.rs:17:36
|
17 | pub use traits::{traits_component, TraitsComponent};
| ^^^^^^^^^^^^^^^
|
unused import: `SkillsComponent`:
src/component/mod.rs#L16
warning: unused import: `SkillsComponent`
--> src/component/mod.rs:16:36
|
16 | pub use skills::{skills_component, SkillsComponent};
| ^^^^^^^^^^^^^^^
|
unused import: `MeritComponent`:
src/component/mod.rs#L15
warning: unused import: `MeritComponent`
--> src/component/mod.rs:15:35
|
15 | pub use merits::{merit_component, MeritComponent};
| ^^^^^^^^^^^^^^
|
unused import: `List`:
src/component/mod.rs#L14
warning: unused import: `List`
--> src/component/mod.rs:14:22
|
14 | pub use list::{list, List};
| ^^^^
|
unused import: `IntegrityComponent`:
src/component/mod.rs#L13
warning: unused import: `IntegrityComponent`
--> src/component/mod.rs:13:42
|
13 | pub use integrity::{integrity_component, IntegrityComponent};
| ^^^^^^^^^^^^^^^^^^
|
unused import: `InfoBar`:
src/component/mod.rs#L12
warning: unused import: `InfoBar`
--> src/component/mod.rs:12:26
|
12 | pub use info::{info_bar, InfoBar};
| ^^^^^^^
|
unused import: `FormsComponent`:
src/component/mod.rs#L11
warning: unused import: `FormsComponent`
--> src/component/mod.rs:11:34
|
11 | pub use forms::{forms_component, FormsComponent};
| ^^^^^^^^^^^^^^
|
unused import: `AttributeBar`:
src/component/mod.rs#L10
warning: unused import: `AttributeBar`
--> src/component/mod.rs:10:37
|
10 | pub use attributes::{attribute_bar, AttributeBar};
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
check
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
check
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
check
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
test
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|