More compact

This commit is contained in:
CDrummond committed 2022-05-28 17:50:19 +01:00
1 parent fa87a7e135
commit cd12e805c3
1 file changed
+1 -4
+1 -4
View File
@@ -61,8 +61,7 @@ fn check_dir_entry(db: &mut db::Db, mpath: &Path, entry: DirEntry, track_paths:
let mut cue_track_path = pb.clone();
let ext = pb.extension().unwrap().to_string_lossy();
cue_track_path.set_extension(format!("{}{}1", ext, db::CUE_MARKER));
match cue_track_path.strip_prefix(mpath) {
Ok(cue_track_stripped) => {
if let Ok(cue_track_stripped) = cue_track_path.strip_prefix(mpath) {
let cue_track_sname = String::from(cue_track_stripped.to_string_lossy());
if let Ok(id) = db.get_rowid(&cue_track_sname) {
if id<=0 {
@@ -70,8 +69,6 @@ fn check_dir_entry(db: &mut db::Db, mpath: &Path, entry: DirEntry, track_paths:
}
}
}
Err(_) => { }
}
} else {
if let Ok(id) = db.get_rowid(&sname) {
if id<=0 {