mirror of
https://github.com/Dummi26/rembackup.git
synced 2025-03-10 13:43:53 +01:00
ignore error when directory creation fails with AlreadyExists
This commit is contained in:
parent
df15ef85bd
commit
90f0a8ded4
@ -33,7 +33,13 @@ pub fn apply_indexchanges_int(
|
|||||||
match change {
|
match change {
|
||||||
IndexChange::AddDir(dir) => {
|
IndexChange::AddDir(dir) => {
|
||||||
let t = target.join(dir);
|
let t = target.join(dir);
|
||||||
if let Err(e) = fs::create_dir(&t) {
|
if let Some(e) = fs::create_dir(&t).err().and_then(|e| {
|
||||||
|
if matches!(e.kind(), io::ErrorKind::AlreadyExists) {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(e)
|
||||||
|
}
|
||||||
|
}) {
|
||||||
eprintln!("\n[warn] couldn't create directory {t:?}: {e}");
|
eprintln!("\n[warn] couldn't create directory {t:?}: {e}");
|
||||||
} else {
|
} else {
|
||||||
fs::create_dir(&index.join(dir))?;
|
fs::create_dir(&index.join(dir))?;
|
||||||
|
Loading…
Reference in New Issue
Block a user