Code cleanup

This commit is contained in:
2025-10-11 15:38:34 -04:00
parent 37a0ca1d70
commit d9f8ec5428
2 changed files with 8 additions and 18 deletions

View File

@@ -114,24 +114,17 @@ impl Song {
let p = std::path::Path::new(&song_path); let p = std::path::Path::new(&song_path);
if p.exists() { if p.exists() {
match std::fs::remove_file(&p) { match std::fs::remove_file(&p) {
Ok(_) => { Ok(_) => Ok(()),
Ok(()) Err(err) => Err(err),
}
Err(err) => {
Err(err)
}
} }
} else { } else {
Ok(()) Ok(())
} }
} }
Err(err) => { Err(err) => Err(err),
Err(err)
} }
} }
} }
}
/// Generates a filename. In order to save a song to the filesystem, the song must have /// Generates a filename. In order to save a song to the filesystem, the song must have
/// a directory and filename /// a directory and filename

View File

@@ -132,15 +132,12 @@ mod song_tests {
}; };
match song::io::copy_song(&song, &mut copied_song) { match song::io::copy_song(&song, &mut copied_song) {
Ok(_) => { Ok(_) => match copied_song.remove_from_filesystem() {
match copied_song.remove_from_filesystem() { Ok(_) => {}
Ok(_) => {
}
Err(err) => { Err(err) => {
assert!(false, "Error: {err:?}") assert!(false, "Error: {err:?}")
} }
} },
}
Err(err) => { Err(err) => {
assert!(false, "Error: {err:?}") assert!(false, "Error: {err:?}")
} }