Feat/better mixer #177
test.yml
on: pull_request
ubuntu / nightly / direct-minimal-versions
42s
Matrix: os-check
Matrix: required
Annotations
4 errors and 16 warnings
ubuntu / nightly / direct-minimal-versions
Process completed with exit code 101.
|
ubuntu / nightly
Process completed with exit code 101.
|
macos-latest / nightly
Process completed with exit code 101.
|
windows-latest / nightly
Process completed with exit code 1.
|
some ranges overlap:
engine/src/asset/sound/dat/pattern_event.rs#L154
warning: some ranges overlap
--> engine/src/asset/sound/dat/pattern_event.rs:154:13
|
154 | 0x35 => Self::FilterLocal,
| ^^^^
|
note: overlaps with this
--> engine/src/asset/sound/dat/pattern_event.rs:155:13
|
155 | 0x35 => Self::FilterLocal,
| ^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_overlapping_arm
= note: `#[warn(clippy::match_overlapping_arm)]` on by default
|
this match arm has an identical body to another arm:
engine/src/asset/sound/dat/pattern_event.rs#L155
warning: this match arm has an identical body to another arm
--> engine/src/asset/sound/dat/pattern_event.rs:155:13
|
155 | 0x35 => Self::FilterLocal,
| ----^^^^^^^^^^^^^^^^^^^^^
| |
| help: try merging the arm patterns: `0x35 | 0x35`
|
= help: or try changing either arm body
note: other arm here
--> engine/src/asset/sound/dat/pattern_event.rs:154:13
|
154 | 0x35 => Self::FilterLocal,
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
= note: `#[warn(clippy::match_same_arms)]` implied by `#[warn(clippy::pedantic)]`
|
use of `expect` followed by a function call:
engine/src/asset/sound/dat/pattern_event.rs#L66
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
|
casting `f32` to `usize` may lose the sign of the value:
engine/src/asset/sound/dat/mixer.rs#L236
warning: casting `f32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:236:29
|
236 | let index = frac.floor() as usize;
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
|
casting `f32` to `usize` may lose the sign of the value:
engine/src/asset/sound/dat/mixer.rs#L231
warning: casting `f32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:231:19
|
231 | 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
|
casting `f64` to `usize` may lose the sign of the value:
engine/src/asset/sound/dat/mixer.rs#L159
warning: casting `f64` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:159:35
|
159 | 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
|
casting `i32` to `usize` may lose the sign of the value:
engine/src/asset/sound/dat/mixer.rs#L149
warning: casting `i32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:149:37
|
149 | &instrument.samples[note.note() as usize]
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_sign_loss
|
casting `f32` to `usize` may lose the sign of the value:
engine/src/asset/sound/dat/mixer.rs#L99
warning: casting `f32` to `usize` may lose the sign of the value
--> engine/src/asset/sound/dat/mixer.rs:99:37
|
99 | 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)]`
|
consider adding a `;` to the last statement for consistent formatting:
engine/src/asset/sound/dat/mixer.rs#L87
warning: consider adding a `;` to the last statement for consistent formatting
--> engine/src/asset/sound/dat/mixer.rs:87:33
|
87 | ... channel.sample_position = effect.value as usize * 256 * 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `channel.sample_position = effect.value as usize * 256 * 3;`
|
= 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)]`
|
explicit `deref` method call:
engine/src/asset/sound/dat/mixer.rs#L49
warning: explicit `deref` method call
--> engine/src/asset/sound/dat/mixer.rs:49:24
|
49 | for row in pattern.deref() {
| ^^^^^^^^^^^^^^^ help: try: `&**pattern`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods
= note: `#[warn(clippy::explicit_deref_methods)]` implied by `#[warn(clippy::pedantic)]`
|
this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
engine/src/asset/sound/dat/finetune.rs#L35
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> engine/src/asset/sound/dat/finetune.rs:35:17
|
35 | pub fn note(&self) -> i32 {
| ^^^^^ help: consider passing by value instead: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
engine/src/asset/sound/dat/finetune.rs#L31
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> engine/src/asset/sound/dat/finetune.rs:31:18
|
31 | pub fn cents(&self) -> i32 {
| ^^^^^ help: consider passing by value instead: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
|
this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte):
engine/src/asset/sound/dat/finetune.rs#L19
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte)
--> engine/src/asset/sound/dat/finetune.rs:19:25
|
19 | pub fn pitch_factor(&self) -> f64 {
| ^^^^^ help: consider passing by value instead: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref
= note: `#[warn(clippy::trivially_copy_pass_by_ref)]` implied by `#[warn(clippy::pedantic)]`
|
docs for function returning `Result` missing `# Errors` section:
engine/src/asset/pack_file.rs#L26
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)]`
|
docs for function which may panic missing `# Panics` section:
engine/src/asset/color_map.rs#L18
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: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
|
long literal lacking separators:
engine/src/asset/sound/dat/finetune.rs#L25
warning: long literal lacking separators
--> engine/src/asset/sound/dat/finetune.rs:25:15
|
25 | * 1048576.0
| ^^^^^^^^^ help: consider: `1_048_576.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal
note: the lint level is defined here
--> engine/src/lib.rs:1:9
|
1 | #![warn(clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: `#[warn(clippy::unreadable_literal)]` implied by `#[warn(clippy::pedantic)]`
|