Skip to content
GitHub Actions / clippy failed Jul 31, 2024 in 1s

clippy

5 errors, 64 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 5
Warning 64
Note 0
Help 0

Versions

  • rustc 1.82.0-nightly (f8060d282 2024-07-30)
  • cargo 1.82.0-nightly (b5d44db1d 2024-07-26)
  • clippy 0.1.82 (f8060d2 2024-07-30)

Annotations

Check warning on line 572 in src/main.rs

See this annotation in the file changed.

@github-actions 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:572:7
    |
572 |                 ..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

See this annotation in the file changed.

@github-actions 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 warning on line 39 in src/view/sheet.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `SheetView`

warning: you should consider adding a `Default` implementation for `SheetView`
  --> src/view/sheet.rs:35:2
   |
35 | /     pub fn new() -> Self {
36 | |         Self {
37 | |             tab: Tab::Overview(overview::OverviewTab::new()),
38 | |         }
39 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
34 + impl Default for SheetView {
35 +     fn default() -> Self {
36 +         Self::new()
37 +     }
38 + }
   |

Check warning on line 261 in src/view/splat_extras.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `Arcanum` which implements the `Copy` trait

warning: using `clone` on type `Arcanum` which implements the `Copy` trait
   --> src/view/splat_extras.rs:261:36
    |
261 | ...                   Some::<Translated<Arcanum>>(rote.arcanum.clone().into()),
    |                                                   ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `rote.arcanum`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy

Check failure on line 121 in src/view/overview.rs

See this annotation in the file changed.

@github-actions 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:121:29
    |
121 |                     character.base_size = (val as i16
    |                                            ^^^^^^^^^^
    |
    = 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 123 in src/view/overview.rs

See this annotation in the file changed.

@github-actions 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:121:28
    |
121 |                       character.base_size = (val as i16
    |  ___________________________________________^
122 | |                         - character.get_modifier(Trait::DerivedTrait(DerivedTrait::Size)))
123 | |                         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 52 in src/view/creator.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `SplatKind` which implements the `Copy` trait

warning: using `clone` on type `SplatKind` which implements the `Copy` trait
  --> src/view/creator.rs:52:38
   |
52 |         let splat: Translated<SplatKind> = self.splat.clone().into();
   |                                            ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.splat`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
   = note: `#[warn(clippy::clone_on_copy)]` on by default

Check warning on line 47 in src/view/creator.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
  --> src/view/creator.rs:47:5
   |
47 |             .into_iter()
   |              ^^^^^^^^^ help: call directly: `iter`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
   = note: `#[warn(clippy::into_iter_on_ref)]` on by default

Check warning on line 24 in src/view/character_list.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `CharacterList`

warning: you should consider adding a `Default` implementation for `CharacterList`
  --> src/view/character_list.rs:22:2
   |
22 | /     pub fn new() -> Self {
23 | |         Self
24 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
21 + impl Default for CharacterList {
22 +     fn default() -> Self {
23 +         Self::new()
24 +     }
25 + }
   |

Check warning on line 76 in src/i18n.rs

See this annotation in the file changed.

@github-actions 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:76:3
   |
76 |         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 100 in src/component/traits.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if` has identical blocks

warning: this `if` has identical blocks
   --> src/component/traits.rs:98:45
    |
98  |           let alternate_xp = if self.traits.alt_opt {
    |  ___________________________________________________^
99  | |             row![]
100 | |         } else {
    | |_________^
    |
note: same as this
   --> src/component/traits.rs:100:10
    |
100 |           } else {
    |  ________________^
101 | |             row![
102 | |             //     text(format!(
103 | |             //     "{}: {}",
...   |
107 | |             ]
108 | |         };
    | |_________^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
    = note: `#[warn(clippy::if_same_then_else)]` on by default

Check warning on line 88 in src/component/skills.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/skills.rs:88:22
   |
88 |             self.mk_skill_col(&character, TraitCategory::Social),
   |                               ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 87 in src/component/skills.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/skills.rs:87:22
   |
87 |             self.mk_skill_col(&character, TraitCategory::Physical),
   |                               ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 86 in src/component/skills.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/skills.rs:86:22
   |
86 |             self.mk_skill_col(&character, TraitCategory::Mental),
   |                               ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 99 in src/component/merits.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/merits.rs:99:38
   |
99 |                     .count() == 0 && e.is_available(&character, attributes, skills)
   |                                                     ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check failure on line 242 in src/component/info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

error: variables can be used directly in the `format!` string
   --> src/component/info.rs:242:26
    |
242 |             col1 = col1.push(text(format!("{}:", str)));
    |                                   ^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
    = note: `#[deny(clippy::uninlined_format_args)]` implied by `#[deny(clippy::pedantic)]`
help: change this to
    |
242 -             col1 = col1.push(text(format!("{}:", str)));
242 +             col1 = col1.push(text(format!("{str}:")));
    |

Check warning on line 219 in src/component/info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/component/info.rs:219:5
    |
219 |                 &character
    |                 ^^^^^^^^^^ help: change this to: `character`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 211 in src/component/info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/component/info.rs:211:5
    |
211 |                 &character
    |                 ^^^^^^^^^^ help: change this to: `character`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 72 in src/component/info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/info.rs:72:5
   |
72 |                 &character,
   |                 ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 49 in src/component/forms.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/forms.rs:49:38
   |
49 |                 row = row.push(self.mk_col(form, &character));
   |                                                  ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 45 in src/component/attributes.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/attributes.rs:45:22
   |
45 |                 self.mk_attr_col(&character, TraitCategory::Social),
   |                                  ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 44 in src/component/attributes.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/attributes.rs:44:22
   |
44 |                 self.mk_attr_col(&character, TraitCategory::Physical),
   |                                  ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 43 in src/component/attributes.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
  --> src/component/attributes.rs:43:22
   |
43 |                 self.mk_attr_col(&character, TraitCategory::Mental),
   |                                  ^^^^^^^^^^ help: change this to: `character`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
   = note: `#[warn(clippy::needless_borrow)]` on by default

Check failure on line 26 in src/component/attributes.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this argument is passed by value, but not consumed in the function body

error: this argument is passed by value, but not consumed in the function body
  --> src/component/attributes.rs:26:36
   |
26 |     pub fn update(&mut self, message: Message, character: &mut Character) {
   |                                       ^^^^^^^ help: consider taking a reference instead: `&Message`
   |
help: consider marking this type as `Copy`
  --> src/component/attributes.rs:19:1
   |
19 | pub struct Message(u16, Attribute);
   | ^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
note: the lint level is defined here
  --> src/main.rs:2:9
   |
2  | #![deny(clippy::pedantic)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[deny(clippy::needless_pass_by_value)]` implied by `#[deny(clippy::pedantic)]`

Check warning on line 16 in src/component/traits.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

fields `alternate_beats`, `alternate_experience`, and `splat` are never read

warning: fields `alternate_beats`, `alternate_experience`, and `splat` are never read
  --> src/component/traits.rs:16:2
   |
9  | struct Traits {
   |        ------ fields in this struct
...
16 |     alternate_beats: u16,
   |     ^^^^^^^^^^^^^^^
17 |     alternate_experience: u16,
   |     ^^^^^^^^^^^^^^^^^^^^
...
21 |     splat: String,
   |     ^^^^^
   |
   = note: `#[warn(dead_code)]` on by default