make loop starts/ends draggable #127
clippy
1 error, 42 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 1 |
Warning | 42 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.88.0-nightly (13e879094 2025-05-04)
- cargo 1.88.0-nightly (7918c7eb5 2025-04-27)
- clippy 0.1.88 (13e8790949 2025-05-04)
Annotations
Check warning on line 65 in pm64/src/sbn/de.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/sbn/de.rs:62:13
|
62 | / warn!(
63 | | "size mismatch! SBN says it is {:#X} B but the input is {:#X} B",
64 | | internal_size, true_size
65 | | );
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
Check warning on line 28 in pm64/src/sbn/de.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/sbn/de.rs:28:34
|
28 | Error::Io(source) => write!(f, "{}", source),
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
28 - Error::Io(source) => write!(f, "{}", source),
28 + Error::Io(source) => write!(f, "{source}"),
|
Check warning on line 64 in pm64/src/rw.rs
github-actions / clippy
calling .bytes() is very inefficient when data is not in memory
warning: calling .bytes() is very inefficient when data is not in memory
--> pm64/src/rw.rs:64:39
|
64 | let buffer: Result<Vec<u8>> = self.take(max_len).bytes().collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `BufReader`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unbuffered_bytes
= note: `#[warn(clippy::unbuffered_bytes)]` on by default
Check warning on line 10 in pm64/src/rw.rs
github-actions / clippy
using `SeekFrom::Current` to start from current position
warning: using `SeekFrom::Current` to start from current position
--> pm64/src/rw.rs:10:9
|
10 | self.seek(SeekFrom::Current(0))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.stream_position()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current
= note: `#[warn(clippy::seek_from_current)]` on by default
Check warning on line 839 in pm64/src/bgm/cmd.rs
github-actions / clippy
this `map_or` can be simplified
warning: this `map_or` can be simplified
--> pm64/src/bgm/cmd.rs:839:23
|
839 | while self.seq.peek().map_or(false, |(t, _)| *t == time) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `#[warn(clippy::unnecessary_map_or)]` on by default
help: use is_some_and instead
|
839 - while self.seq.peek().map_or(false, |(t, _)| *t == time) {
839 + while self.seq.peek().is_some_and(|(t, _)| *t == time) {
|
Check warning on line 803 in pm64/src/bgm/cmd.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> pm64/src/bgm/cmd.rs:803:42
|
803 | self.current_time += *delta_time as usize;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `*delta_time`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 441 in pm64/src/bgm/cmd.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> pm64/src/bgm/cmd.rs:441:33
|
441 | current_time += *delta_time as usize;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `*delta_time`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 270 in pm64/src/bgm/cmd.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> pm64/src/bgm/cmd.rs:270:55
|
270 | Command::Delay { value: delta } => time + delta as usize,
| ^^^^^^^^^^^^^^ help: try: `delta`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 257 in pm64/src/bgm/cmd.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> pm64/src/bgm/cmd.rs:257:25
|
257 | time += *delta_time as usize;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `*delta_time`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 518 in pm64/src/bgm/midi.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/midi.rs:518:30
|
518 | let name_lower = format!("{:?} {:?}", track_name, instrument_name).to_lowercase();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
518 - let name_lower = format!("{:?} {:?}", track_name, instrument_name).to_lowercase();
518 + let name_lower = format!("{track_name:?} {instrument_name:?}").to_lowercase();
|
Check warning on line 464 in pm64/src/bgm/midi.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/midi.rs:464:29
|
464 | ... log::debug!("bpm: {}", beats_per_minute);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
464 - log::debug!("bpm: {}", beats_per_minute);
464 + log::debug!("bpm: {beats_per_minute}");
|
Check warning on line 430 in pm64/src/bgm/midi.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> pm64/src/bgm/midi.rs:430:74
|
430 | ... length: convert_time(length as usize, time_divisor) as u16,
| ^^^^^^^^^^^^^^^ help: try: `length`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Check warning on line 304 in pm64/src/bgm/midi.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/midi.rs:304:41
|
304 | ... log::warn!("found NoteOn(vel=0) {} but saw no NoteOn(vel>0)", key);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
304 - log::warn!("found NoteOn(vel=0) {} but saw no NoteOn(vel>0)", key);
304 + log::warn!("found NoteOn(vel=0) {key} but saw no NoteOn(vel>0)");
|
Check warning on line 279 in pm64/src/bgm/midi.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/midi.rs:279:37
|
279 | ... log::warn!("found NoteOff {} but saw no NoteOn", key);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
279 - log::warn!("found NoteOff {} but saw no NoteOn", key);
279 + log::warn!("found NoteOff {key} but saw no NoteOn");
|
Check warning on line 65 in pm64/src/bgm/midi.rs
github-actions / clippy
accessing first element with `smf.tracks.get(0)`
warning: accessing first element with `smf.tracks.get(0)`
--> pm64/src/bgm/midi.rs:65:17
|
65 | smf.tracks.get(0),
| ^^^^^^^^^^^^^^^^^ help: try: `smf.tracks.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
Check warning on line 59 in pm64/src/bgm/midi.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/midi.rs:59:5
|
59 | log::debug!("song length: {} ticks (48 ticks/beat)", total_song_length);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
59 - log::debug!("song length: {} ticks (48 ticks/beat)", total_song_length);
59 + log::debug!("song length: {total_song_length} ticks (48 ticks/beat)");
|
Check warning on line 33 in pm64/src/bgm/midi.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/midi.rs:33:5
|
33 | log::debug!("original ticks/beat: {}", ticks_per_beat);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
33 - log::debug!("original ticks/beat: {}", ticks_per_beat);
33 + log::debug!("original ticks/beat: {ticks_per_beat}");
|
Check warning on line 598 in pm64/src/bgm/de.rs
github-actions / clippy
iterating on a map's values
warning: iterating on a map's values
--> pm64/src/bgm/de.rs:598:9
|
598 | map.0.into_iter().map(|(_, cmd)| cmd).collect()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map.0.into_values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
Check warning on line 591 in pm64/src/bgm/de.rs
github-actions / clippy
manual backwards iteration
warning: manual backwards iteration
--> pm64/src/bgm/de.rs:589:20
|
589 | .iter()
| ____________________^
590 | | .rev()
591 | | .next() //self.0.last_key_value()
| |___________________^ help: use: `.next_back()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_next_back
= note: `#[warn(clippy::manual_next_back)]` on by default
Check warning on line 570 in pm64/src/bgm/de.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/de.rs:570:36
|
570 | let id: MarkerId = format!("Offset {:#X}", offset);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
570 - let id: MarkerId = format!("Offset {:#X}", offset);
570 + let id: MarkerId = format!("Offset {offset:#X}");
|
Check failure on line 533 in pm64/src/bgm/de.rs
github-actions / clippy
this loop never actually loops
error: this loop never actually loops
--> pm64/src/bgm/de.rs:531:9
|
531 | / for (offset, command) in commands.0.split_off(&OffsetEventMap::atob(size)).into_iter() {
532 | | panic!("command after end of parsed sequence {:?} @ {:#X}", command, offset);
533 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
= note: `#[deny(clippy::never_loop)]` on by default
help: if you need the first element of the iterator, try writing
|
531 - for (offset, command) in commands.0.split_off(&OffsetEventMap::atob(size)).into_iter() {
531 + if let Some((offset, command)) = commands.0.split_off(&OffsetEventMap::atob(size)).into_iter().next() {
|
Check warning on line 287 in pm64/src/bgm/de.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> pm64/src/bgm/de.rs:287:43
|
287 | ... std::mem::transmute(tracks)
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<[std::mem::MaybeUninit<bgm::Track>; 16], [bgm::Track; 16]>`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
= note: `#[warn(clippy::missing_transmute_annotations)]` on by default
Check warning on line 255 in pm64/src/bgm/de.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/de.rs:255:17
|
255 | debug!("tracks start = {:#X} (offset = {:#X})", track_list_pos, offset);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
255 - debug!("tracks start = {:#X} (offset = {:#X})", track_list_pos, offset);
255 + debug!("tracks start = {track_list_pos:#X} (offset = {offset:#X})");
|
Check warning on line 231 in pm64/src/bgm/de.rs
github-actions / clippy
variables can be used directly in the `format!` string
warning: variables can be used directly in the `format!` string
--> pm64/src/bgm/de.rs:231:13
|
231 | warn!("unused data at {:#X}", furthest_read_pos);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
231 - warn!("unused data at {:#X}", furthest_read_pos);
231 + warn!("unused data at {furthest_read_pos:#X}");
|
Check warning on line 221 in pm64/src/bgm/de.rs
github-actions / clippy
useless conversion to the same type: `std::ops::Range<u16>`
warning: useless conversion to the same type: `std::ops::Range<u16>`
--> pm64/src/bgm/de.rs:220:31
|
220 | bgm.instruments = (0..voices_count)
| _______________________________^
221 | | .into_iter()
| |____________________________^ help: consider removing `.into_iter()`: `(0..voices_count)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion