diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 93ee8b47a5017..7f256e6fae03e 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1299,6 +1299,20 @@ impl DirBuilder { /// Create the specified directory with the options configured in this /// builder. + /// + /// # Examples + /// + /// ```no_run + /// #![feature(dir_builder)] + /// use std::fs::{self, DirBuilder}; + /// + /// let path = "/tmp/foo/bar/baz"; + /// DirBuilder::new() + /// .recursive(true) + /// .create(path).unwrap(); + /// + /// assert!(fs::metadata(path).unwrap().is_dir()); + /// ``` pub fn create>(&self, path: P) -> io::Result<()> { self._create(path.as_ref()) }