clippy
10 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 10 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.78.0-nightly (bccb9bbb4 2024-02-16)
- cargo 1.78.0-nightly (fc1d58fd0 2024-02-09)
- clippy 0.1.78 (bccb9bb 2024-02-16)
Annotations
Check warning on line 34 in engine/src/asset/sound/dat/t_instrument.rs
github-actions / clippy
use of `expect` followed by a function call
warning: use of `expect` followed by a function call
--> engine/src/asset/sound/dat/t_instrument.rs:32:52
|
32 | TInstrumentFlags::from_bits(flags).expect(&format!(
| ____________________________________________________^
33 | | "PatternEvent flags should be valid: received: {flags:b}"
34 | | )),
| |__________________^ help: try: `unwrap_or_else(|| panic!("PatternEvent flags should be valid: received: {flags:b}"))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
Check warning on line 68 in engine/src/asset/sound/dat/pattern_event.rs
github-actions / clippy
use of `expect` followed by a function call
warning: use of `expect` followed by a function call
--> engine/src/asset/sound/dat/pattern_event.rs:66:53
|
66 | PatternEventFlags::from_bits(flags).expect(&format!(
| _____________________________________________________^
67 | | "PatternEvent flags should be valid: received: {flags:b}"
68 | | )),
| |__________________^ help: try: `unwrap_or_else(|| panic!("PatternEvent flags should be valid: received: {flags:b}"))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
= note: `#[warn(clippy::expect_fun_call)]` on by default
Check warning on line 241 in engine/src/asset/sound/dat/mixer.rs
github-actions / clippy
casting `f32` to `usize` may lose the sign of the value
warning: casting `f32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:241:29
|
241 | let index = frac.floor() as usize;
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
Check warning on line 236 in engine/src/asset/sound/dat/mixer.rs
github-actions / clippy
casting `f32` to `usize` may lose the sign of the value
warning: casting `f32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:236:19
|
236 | let len = (self.len() as f32 * factor).round() as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
Check warning on line 164 in engine/src/asset/sound/dat/mixer.rs
github-actions / clippy
casting `f64` to `usize` may lose the sign of the value
warning: casting `f64` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:164:35
|
164 | let duration_scaled = (duration as f64 / pitch_factor).round() as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
Check warning on line 155 in engine/src/asset/sound/dat/mixer.rs
github-actions / clippy
casting `i32` to `usize` may lose the sign of the value
warning: casting `i32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:155:37
|
155 | &instrument.samples[note.finetune.note() as usize]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
Check warning on line 88 in engine/src/asset/sound/dat/mixer.rs
github-actions / clippy
casting `f32` to `usize` may lose the sign of the value
warning: casting `f32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:88:37
|
88 | let sample_length = sample_length as usize;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
= note: `#[warn(clippy::cast_sign_loss)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 61 in engine/src/asset/sound/dat/mixer.rs
github-actions / clippy
consider adding a `;` to the last statement for consistent formatting
warning: consider adding a `;` to the last statement for consistent formatting
--> engine/src/asset/sound/dat/mixer.rs:61:25
|
61 | channel.volume = volume
| ^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `channel.volume = volume;`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
= note: `#[warn(clippy::semicolon_if_nothing_returned)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 26 in engine/src/asset/pack_file.rs
github-actions / clippy
docs for function returning `Result` missing `# Errors` section
warning: docs for function returning `Result` missing `# Errors` section
--> engine/src/asset/pack_file.rs:26:5
|
26 | pub fn new(input: &[u8]) -> Result<Self> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc
= note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
Check warning on line 18 in engine/src/asset/color_map.rs
github-actions / clippy
docs for function which may panic missing `# Panics` section
warning: docs for function which may panic missing `# Panics` section
--> engine/src/asset/color_map.rs:18:5
|
18 | pub fn from_12_bit(color: u16) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> engine/src/asset/color_map.rs:20:9
|
20 | assert!(color <= 0xFFF, "12 bit color is smaller than 0xFFF");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
note: the lint level is defined here
--> engine/src/lib.rs:1:9
|
1 | #![warn(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`