mirror of
https://github.com/figsoda/mmtc
synced 2024-11-22 07:03:05 +00:00
collapse else if block
This commit is contained in:
parent
15175be091
commit
762207c1bc
1 changed files with 9 additions and 11 deletions
20
src/mpd.rs
20
src/mpd.rs
|
@ -92,18 +92,16 @@ pub async fn queue(cl: &mut Client) -> Result<Vec<Track>> {
|
|||
expand!([@b"file: ", xs @ ..]) => {
|
||||
if first {
|
||||
first = false;
|
||||
} else if let (Some(file), Some(time)) = (file, time) {
|
||||
tracks.push(Track {
|
||||
file,
|
||||
artist,
|
||||
album,
|
||||
title,
|
||||
time,
|
||||
});
|
||||
} else {
|
||||
if let (Some(file), Some(time)) = (file, time) {
|
||||
tracks.push(Track {
|
||||
file,
|
||||
artist,
|
||||
album,
|
||||
title,
|
||||
time,
|
||||
});
|
||||
} else {
|
||||
bail!("incomplete playlist response");
|
||||
}
|
||||
bail!("incomplete playlist response");
|
||||
}
|
||||
|
||||
file = Some(String::from_utf8_lossy(xs).into());
|
||||
|
|
Loading…
Reference in a new issue