Skip to content

Commit

Permalink
only push backup dir if successfully parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
mxve committed Dec 22, 2022
1 parent 97c6ba9 commit fec4d05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ fn get_backups(install_dir: &Path) -> Vec<u16> {
let dirs = get_subdirs(&Path::join(install_dir, "backup")).unwrap_or_else(|_| vec![]);
let mut backups: Vec<u16> = vec![];
for d in dirs {
backups.push(d.file_name().unwrap().to_string_lossy().parse().unwrap())
let sd = d.file_name().unwrap().to_str().unwrap();
if let Ok(name) = sd.parse::<u16>() {
backups.push(name);
}
}
backups.sort_unstable();
backups
Expand Down

0 comments on commit fec4d05

Please sign in to comment.