Reorder match checks in create_dir_all
Avoid doing `is_dir` in the fast path.
This commit is contained in:
parent
c3e2eaf4cb
commit
bcae6a3734
1 changed files with 1 additions and 1 deletions
|
|
@ -1777,8 +1777,8 @@ impl DirBuilder {
|
|||
fn create_dir_all(&self, path: &Path) -> io::Result<()> {
|
||||
match self.inner.mkdir(path) {
|
||||
Ok(()) => return Ok(()),
|
||||
Err(_) if path.is_dir() => return Ok(()),
|
||||
Err(ref e) if e.kind() == io::ErrorKind::NotFound => {}
|
||||
Err(_) if path.is_dir() => return Ok(()),
|
||||
Err(e) => return Err(e),
|
||||
}
|
||||
match path.parent() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue