File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1777,7 +1777,7 @@ impl DirBuilder {
1777
1777
fn create_dir_all ( & self , path : & Path ) -> io:: Result < ( ) > {
1778
1778
match self . inner . mkdir ( path) {
1779
1779
Ok ( ( ) ) => return Ok ( ( ) ) ,
1780
- Err ( ref e) if e. kind ( ) == io:: ErrorKind :: AlreadyExists => return Ok ( ( ) ) ,
1780
+ Err ( ref e) if e. kind ( ) == io:: ErrorKind :: AlreadyExists && path . is_dir ( ) => return Ok ( ( ) ) ,
1781
1781
Err ( ref e) if e. kind ( ) == io:: ErrorKind :: NotFound => { }
1782
1782
Err ( e) => return Err ( e) ,
1783
1783
}
@@ -1787,7 +1787,7 @@ impl DirBuilder {
1787
1787
}
1788
1788
match self . inner . mkdir ( path) {
1789
1789
Ok ( ( ) ) => Ok ( ( ) ) ,
1790
- Err ( ref e) if e. kind ( ) == io:: ErrorKind :: AlreadyExists => Ok ( ( ) ) ,
1790
+ Err ( ref e) if e. kind ( ) == io:: ErrorKind :: AlreadyExists && path . is_dir ( ) => Ok ( ( ) ) ,
1791
1791
Err ( e) => Err ( e) ,
1792
1792
}
1793
1793
}
You can’t perform that action at this time.
0 commit comments