mirror of
https://github.com/denisidoro/navi
synced 2024-11-13 23:37:10 +00:00
Fix remove dir panicing when the dir does not exist, but when the purpose is to make place for a replacement.
This commit is contained in:
parent
09dfc32d2c
commit
ec0bbf4e76
1 changed files with 4 additions and 1 deletions
|
@ -12,7 +12,10 @@ use walkdir::WalkDir;
|
|||
pub fn browse() -> Result<(), Error> {
|
||||
let repo_path_str = format!("{}/featured", filesystem::tmp_path_str()?);
|
||||
|
||||
filesystem::remove_dir(&repo_path_str)?;
|
||||
// The dir might not exist which would throw an error. But here we don't care about that
|
||||
// since our purpose is to make space for a new directory. Potential other errors
|
||||
// (e.g due to lack of permission) will cause an error during dir creation.
|
||||
let _ = filesystem::remove_dir(&repo_path_str);
|
||||
filesystem::create_dir(&repo_path_str)?;
|
||||
|
||||
let repo_url = "https://github.com/denisidoro/cheats";
|
||||
|
|
Loading…
Reference in a new issue