mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Apply some clippy suggestions
This commit is contained in:
parent
e26444c982
commit
0926d912eb
4 changed files with 6 additions and 8 deletions
|
|
@ -185,7 +185,7 @@ impl MusicusHomePage {
|
||||||
items.push(PlaylistItem::new(
|
items.push(PlaylistItem::new(
|
||||||
true,
|
true,
|
||||||
&title,
|
&title,
|
||||||
performances.as_ref().map(|x| x.as_str()),
|
performances.as_deref(),
|
||||||
None,
|
None,
|
||||||
&tracks[0].path,
|
&tracks[0].path,
|
||||||
));
|
));
|
||||||
|
|
@ -212,7 +212,7 @@ impl MusicusHomePage {
|
||||||
items.push(PlaylistItem::new(
|
items.push(PlaylistItem::new(
|
||||||
true,
|
true,
|
||||||
&title,
|
&title,
|
||||||
performances.as_ref().map(|x| x.as_str()),
|
performances.as_deref(),
|
||||||
Some(&track_title(&first_track, 1)),
|
Some(&track_title(&first_track, 1)),
|
||||||
&first_track.path,
|
&first_track.path,
|
||||||
));
|
));
|
||||||
|
|
@ -221,7 +221,7 @@ impl MusicusHomePage {
|
||||||
items.push(PlaylistItem::new(
|
items.push(PlaylistItem::new(
|
||||||
false,
|
false,
|
||||||
&title,
|
&title,
|
||||||
performances.as_ref().map(|x| x.as_str()),
|
performances.as_deref(),
|
||||||
// track number = track index + 1 (first track) + 1 (zero based)
|
// track number = track index + 1 (first track) + 1 (zero based)
|
||||||
Some(&track_title(&track, index + 2)),
|
Some(&track_title(&track, index + 2)),
|
||||||
&track.path,
|
&track.path,
|
||||||
|
|
|
||||||
|
|
@ -380,7 +380,7 @@ impl MusicusLibrary {
|
||||||
.get::<_, String>(4)?
|
.get::<_, String>(4)?
|
||||||
.split(',')
|
.split(',')
|
||||||
.filter(|s| !s.is_empty())
|
.filter(|s| !s.is_empty())
|
||||||
.map(|s| str::parse::<usize>(s))
|
.map(str::parse::<usize>)
|
||||||
.collect::<Result<Vec<usize>, ParseIntError>>()
|
.collect::<Result<Vec<usize>, ParseIntError>>()
|
||||||
.expect("work part IDs should be valid integers"),
|
.expect("work part IDs should be valid integers"),
|
||||||
path: PathBuf::from(self.folder()).join(row.get::<_, String>(6)?),
|
path: PathBuf::from(self.folder()).join(row.get::<_, String>(6)?),
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ mod imp {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
let uri = glib::filename_to_uri(&item.path(), None)
|
let uri = glib::filename_to_uri(item.path(), None)
|
||||||
.expect("track path should be parsable as an URI");
|
.expect("track path should be parsable as an URI");
|
||||||
|
|
||||||
let player = self.player.get().unwrap();
|
let player = self.player.get().unwrap();
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,7 @@ mod imp {
|
||||||
|
|
||||||
self.remaining_time_label.set_label(&format_time(
|
self.remaining_time_label.set_label(&format_time(
|
||||||
player
|
player
|
||||||
.duration_ms()
|
.duration_ms().saturating_sub(current_time_ms),
|
||||||
.checked_sub(current_time_ms)
|
|
||||||
.unwrap_or(0),
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue