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,25 +114,18 @@ impl Song {
let p = std::path::Path::new(&song_path);
if p.exists() {
match std::fs::remove_file(&p) {
Ok(_) => {
Ok(())
}
Err(err) => {
Err(err)
}
Ok(_) => Ok(()),
Err(err) => Err(err),
}
} else {
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
/// a directory and filename
pub fn generate_filename(typ: types::MusicTypes, randomize: bool) -> String {

View File

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