Skip to content

Refactor components #49

Refactor components

Refactor components #49

GitHub Actions / clippy failed Jul 31, 2024 in 0s

clippy

4 errors, 2 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 4
Warning 2
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 failure on line 241 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: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 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 failure on line 26 in src/component/traits.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/component/traits.rs:26:28
   |
26 |                 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 28 in src/component/traits.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/component/traits.rs:26:27
   |
26 |                   character.base_size = (val as i16
   |  _______________________________________^
27 | |                     - character.get_modifier(Trait::DerivedTrait(DerivedTrait::Size)))
28 | |                     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 failure on line 21 in src/component/traits.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/traits.rs:21:36
   |
21 |     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/traits.rs:14:1
   |
14 | pub struct Message(u16, Trait);
   | ^^^^^^^^^^^^^^^^^^
   = 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 13 in src/view/overview.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `traits::DerivedTrait`

warning: unused import: `traits::DerivedTrait`
  --> src/view/overview.rs:13:2
   |
13 |     traits::DerivedTrait,
   |     ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default