mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
Document behavior of create_dir_all
wrt. empty path
The behavior makes sense because `Path::new("one_component").parent() == Some(Path::new(""))`, so if one naively wants to create the parent directory for a file to be written, it simply works. Closes #105108 by documenting the current behavior.
This commit is contained in:
parent
58426f4a5b
commit
6add5c99cd
@ -2310,6 +2310,9 @@ pub fn create_dir<P: AsRef<Path>>(path: P) -> io::Result<()> {
|
||||
/// If this function returns an error, some of the parent components might have
|
||||
/// been created already.
|
||||
///
|
||||
/// If the empty path is passed to this function, it always succeeds without
|
||||
/// creating any directories.
|
||||
///
|
||||
/// # Platform-specific behavior
|
||||
///
|
||||
/// This function currently corresponds to multiple calls to the `mkdir`
|
||||
|
Loading…
Reference in New Issue
Block a user