Skip to content

clippy

clippy #36

Triggered via push March 12, 2024 18:12
Status Failure
Total duration 3m 35s
Artifacts

dev.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

18 errors and 25 warnings
casting `u16` to `i16` may wrap around the value: cofd/lib/src/splat/werewolf.rs#L617
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/splat/werewolf.rs:617:36 | 617 | ModifierTarget::Trait(trait_) => character.get_trait(trait_) as i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u16` to `i16` may wrap around the value: cofd/lib/src/splat/werewolf.rs#L616
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/splat/werewolf.rs:616:38 | 616 | ModifierTarget::Attribute(attr) => *character.attributes().get(&attr) as i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u16` to `i16` may wrap around the value: cofd/lib/src/dice_pool.rs#L35
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/dice_pool.rs:35:27 | 35 | Self::Trait(trait_) => character.get_trait(trait_) as i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u16` to `i16` may wrap around the value: cofd/lib/src/dice_pool.rs#L34
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/dice_pool.rs:34:26 | 34 | Self::Skill(skill) => character.skills().get(*skill) as i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u16` to `i16` may wrap around the value: cofd/lib/src/dice_pool.rs#L33
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/dice_pool.rs:33:29 | 33 | Self::Attribute(attr) => *character.attributes().get(attr) as i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `i16` to `u16` may lose the sign of the value: cofd/lib/src/character/mod.rs#L563
error: casting `i16` to `u16` may lose the sign of the value --> cofd/lib/src/character/mod.rs:563:3 | 563 | max::<i16>(0, self.get_pool(Trait::Defense).unwrap().value(self)) 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)]`
docs for function which may panic missing `# Panics` section: cofd/lib/src/character/mod.rs#L562
error: docs for function which may panic missing `# Panics` section --> cofd/lib/src/character/mod.rs:562:2 | 562 | pub fn defense(&self) -> u16 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> cofd/lib/src/character/mod.rs:563:17 | 563 | max::<i16>(0, self.get_pool(Trait::Defense).unwrap().value(self)) as u16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: cofd/lib/src/character/modifier.rs#L406
error: docs for function which may panic missing `# Panics` section --> cofd/lib/src/character/modifier.rs:406:2 | 406 | / pub fn get_conditional_pool( 407 | | &self, 408 | | target: impl Into<ModifierTarget>, 409 | | condition: impl Into<Condition>, 410 | | ) -> Option<DicePool> { | |_________________________^ | note: first possible panic found here --> cofd/lib/src/character/modifier.rs:411:22 | 411 | let modifier_map = self.modifier_map.read().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: cofd/lib/src/character/modifier.rs#L362
error: docs for function which may panic missing `# Panics` section --> cofd/lib/src/character/modifier.rs:362:2 | 362 | / pub fn get_pool( 363 | | &self, 364 | | character: &Character, 365 | | target: impl Into<ModifierTarget>, 366 | | ) -> Option<DicePool> { | |_________________________^ | note: first possible panic found here --> cofd/lib/src/character/modifier.rs:367:22 | 367 | let modifier_map = self.modifier_map.read().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: cofd/lib/src/character/modifier.rs#L346
error: docs for function which may panic missing `# Panics` section --> cofd/lib/src/character/modifier.rs:346:2 | 346 | / pub fn get_conditional_modifier( 347 | | &self, 348 | | character: &Character, 349 | | target: impl Into<ModifierTarget>, 350 | | condition: impl Into<Condition>, 351 | | ) -> Option<i16> { | |____________________^ | note: first possible panic found here --> cofd/lib/src/character/modifier.rs:355:34 | 355 | let conditional_modifier_map = self.conditional_modifier_map.read().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: cofd/lib/src/character/modifier.rs#L321
error: docs for function which may panic missing `# Panics` section --> cofd/lib/src/character/modifier.rs:321:2 | 321 | pub fn get_modifier(&self, character: &Character, target: impl Into<ModifierTarget>) -> i16 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> cofd/lib/src/character/modifier.rs:325:22 | 325 | let modifier_map = self.modifier_map.read().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
docs for function which may panic missing `# Panics` section: cofd/lib/src/character/modifier.rs#L219
error: docs for function which may panic missing `# Panics` section --> cofd/lib/src/character/modifier.rs:219:2 | 219 | pub fn update(&self, character: &Character) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> cofd/lib/src/character/modifier.rs:220:38 | 220 | let mut conditional_modifier_map = self.conditional_modifier_map.write().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc = note: `#[deny(clippy::missing_panics_doc)]` implied by `#[deny(clippy::pedantic)]`
casting `i32` to `i16` may truncate the value: cofd/lib/src/character/modifier.rs#L121
error: casting `i32` to `i16` may truncate the value --> cofd/lib/src/character/modifier.rs:121:22 | 121 | ModifierValue::Num(value as i16) | ^^^^^^^^^^^^ | = 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 | 121 | ModifierValue::Num(i16::try_from(value)) | ~~~~~~~~~~~~~~~~~~~~
casting `u16` to `i16` may wrap around the value: cofd/lib/src/character/modifier.rs#L115
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/character/modifier.rs:115:22 | 115 | ModifierValue::Num(value as i16) | ^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u16` to `i16` may wrap around the value: cofd/lib/src/character/modifier.rs#L101
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/character/modifier.rs:101:35 | 101 | ModifierValue::Skill(skill) => character.skills.get(*skill) as i16, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u16` to `i16` may wrap around the value: cofd/lib/src/character/modifier.rs#L99
error: casting `u16` to `i16` may wrap around the value --> cofd/lib/src/character/modifier.rs:99:5 | 99 | *character.get_ability_value(ability).unwrap_or(&0) as i16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap note: the lint level is defined here --> cofd/lib/src/lib.rs:2:9 | 2 | #![deny(clippy::pedantic)] | ^^^^^^^^^^^^^^^^ = note: `#[deny(clippy::cast_possible_wrap)]` 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
this expression creates a reference which is immediately dereferenced by the compiler: cofd/lib/src/splat/werewolf.rs#L616
warning: this expression creates a reference which is immediately dereferenced by the compiler --> cofd/lib/src/splat/werewolf.rs:616:66 | 616 | ModifierTarget::Attribute(attr) => *character.attributes().get(&attr) as i16, | ^^^^^ help: change this to: `attr` | = 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
writing `&String` instead of `&str` involves a new object where a slice will do: cofd/lib/src/character/mod.rs#L639
warning: writing `&String` instead of `&str` involves a new object where a slice will do --> cofd/lib/src/character/mod.rs:639:18 | 639 | fn is_empty(str: &String) -> bool { | ^^^^^^^ help: change this to: `&str` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: cofd/lib/src/character/mod.rs#L281
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> cofd/lib/src/character/mod.rs:281:26 | 281 | pub fn is_empty_vec(vec: &Vec<String>) -> bool { | ^^^^^^^^^^^^ help: change this to: `&[String]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
function `form_pool` is never used: cofd/lib/src/splat/werewolf.rs#L678
warning: function `form_pool` is never used --> cofd/lib/src/splat/werewolf.rs:678:4 | 678 | fn form_pool( | ^^^^^^^^^
unused variable: `value`: cofd/lib/src/splat/vampire.rs#L310
warning: unused variable: `value` --> cofd/lib/src/splat/vampire.rs:310:30 | 310 | pub fn get_modifiers(&self, value: u16) -> Vec<Modifier> { | ^^^^^ help: if this is intentional, prefix it with an underscore: `_value` | = note: `#[warn(unused_variables)]` on by default
the item `Character` is imported redundantly: cofd/lib/src/splat/changeling.rs#L7
warning: the item `Character` is imported redundantly --> cofd/lib/src/splat/changeling.rs:7:3 | 7 | Character, Damage, | ^^^^^^^^^ 8 | }, 9 | prelude::*, | ---------- the item `Character` is already imported here
unused import: `Character`: cofd/lib/src/splat/merits.rs#L11
warning: unused import: `Character` --> cofd/lib/src/splat/merits.rs:11:24 | 11 | prelude::{Attributes, Character, Skill, Skills, Trait}, | ^^^^^^^^^
unused imports: `Attributes`, `Character`, `ModifierOp`, `ModifierTarget`, `ModifierValue`, `Modifier`, `Skills`, `Trait`: cofd/lib/src/splat/mod.rs#L7
warning: unused imports: `Attributes`, `Character`, `ModifierOp`, `ModifierTarget`, `ModifierValue`, `Modifier`, `Skills`, `Trait` --> cofd/lib/src/splat/mod.rs:7:24 | 7 | character::modifier::{Modifier, ModifierOp, ModifierTarget, ModifierValue}, | ^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ 8 | character::traits::AttributeType, 9 | prelude::{Attribute, Attributes, Character, Skill, Skills, Trait}, | ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^ ^^^^^
unused import: `Index`: cofd/lib/src/character/mod.rs#L5
warning: unused import: `Index` --> cofd/lib/src/character/mod.rs:5:13 | 5 | ops::{Add, Index, Sub}, | ^^^^^ | = note: `#[warn(unused_imports)]` on by default
the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes: cofd/util/src/lib.rs#L1
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> cofd/util/src/lib.rs:1:12 | 1 | #![feature(generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information = note: `#[warn(incomplete_features)]` on by default
unused variable: `merit`: cofd/macros/src/lib.rs#L144
warning: unused variable: `merit` --> cofd/macros/src/lib.rs:144:6 | 144 | for merit in vec {} | ^^^^^ help: if this is intentional, prefix it with an underscore: `_merit` | = note: `#[warn(unused_variables)]` on by default
the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes: cofd/util/src/lib.rs#L1
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes --> cofd/util/src/lib.rs:1:12 | 1 | #![feature(generic_const_exprs)] | ^^^^^^^^^^^^^^^^^^^ | = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information = note: `#[warn(incomplete_features)]` on by default
name `XYZ` contains a capitalized acronym: cofd/derive/src/lib.rs#L152
warning: name `XYZ` contains a capitalized acronym --> cofd/derive/src/lib.rs:152:6 | 152 | enum XYZ { | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Xyz` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms = note: `#[warn(clippy::upper_case_acronyms)]` on by default
check
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
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 `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
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
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 `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/