diff options
Diffstat (limited to 'vendor/gix-fs/src/dir')
-rw-r--r-- | vendor/gix-fs/src/dir/create.rs | 14 | ||||
-rw-r--r-- | vendor/gix-fs/src/dir/remove.rs | 3 |
2 files changed, 8 insertions, 9 deletions
diff --git a/vendor/gix-fs/src/dir/create.rs b/vendor/gix-fs/src/dir/create.rs index 7c7c9a033..642629bfd 100644 --- a/vendor/gix-fs/src/dir/create.rs +++ b/vendor/gix-fs/src/dir/create.rs @@ -116,7 +116,7 @@ impl<'a> Iter<'a> { } impl<'a> Iter<'a> { - fn pernanent_failure( + fn permanent_failure( &mut self, dir: &'a Path, err: impl Into<std::io::Error>, @@ -151,24 +151,24 @@ impl<'a> Iterator for Iter<'a> { self.state = State::CurrentlyCreatingDirectories; Some(Ok(dir)) } - AlreadyExists => self.pernanent_failure(dir, err), // is non-directory + AlreadyExists => self.permanent_failure(dir, err), // is non-directory NotFound => { self.retries.on_create_directory_failure -= 1; if let State::CurrentlyCreatingDirectories = self.state { self.state = State::SearchingUpwardsForExistingDirectory; self.retries.to_create_entire_directory -= 1; if self.retries.to_create_entire_directory < 1 { - return self.pernanent_failure(dir, NotFound); + return self.permanent_failure(dir, NotFound); } self.retries.on_create_directory_failure = self.original_retries.on_create_directory_failure; } if self.retries.on_create_directory_failure < 1 { - return self.pernanent_failure(dir, NotFound); + return self.permanent_failure(dir, NotFound); }; self.cursors.push(dir); self.cursors.push(match dir.parent() { - None => return self.pernanent_failure(dir, InvalidInput), + None => return self.permanent_failure(dir, InvalidInput), Some(parent) => parent, }); self.intermediate_failure(dir, err) @@ -176,12 +176,12 @@ impl<'a> Iterator for Iter<'a> { Interrupted => { self.retries.on_interrupt -= 1; if self.retries.on_interrupt <= 1 { - return self.pernanent_failure(dir, Interrupted); + return self.permanent_failure(dir, Interrupted); }; self.cursors.push(dir); self.intermediate_failure(dir, err) } - _unexpected_kind => self.pernanent_failure(dir, err), + _unexpected_kind => self.permanent_failure(dir, err), }, }, None => None, diff --git a/vendor/gix-fs/src/dir/remove.rs b/vendor/gix-fs/src/dir/remove.rs index ac7b212fa..cb5bff47c 100644 --- a/vendor/gix-fs/src/dir/remove.rs +++ b/vendor/gix-fs/src/dir/remove.rs @@ -78,8 +78,7 @@ pub fn empty_upward_until_boundary<'a>(delete_dir: &'a Path, boundary_dir: &'a P /// If any encountered directory contains a file the entire operation is aborted. /// Please note that this is inherently racy and no attempts are made to counter that, which will allow creators to win /// as long as they retry. -pub fn empty_depth_first(delete_dir: impl Into<PathBuf>) -> std::io::Result<()> { - let delete_dir = delete_dir.into(); +pub fn empty_depth_first(delete_dir: PathBuf) -> std::io::Result<()> { if let Ok(()) = std::fs::remove_dir(&delete_dir) { return Ok(()); } |