We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5854fed + 4463070 commit 4cedff7Copy full SHA for 4cedff7
src/libstd/fs.rs
@@ -1299,6 +1299,20 @@ impl DirBuilder {
1299
1300
/// Create the specified directory with the options configured in this
1301
/// builder.
1302
+ ///
1303
+ /// # Examples
1304
1305
+ /// ```no_run
1306
+ /// #![feature(dir_builder)]
1307
+ /// use std::fs::{self, DirBuilder};
1308
1309
+ /// let path = "/tmp/foo/bar/baz";
1310
+ /// DirBuilder::new()
1311
+ /// .recursive(true)
1312
+ /// .create(path).unwrap();
1313
1314
+ /// assert!(fs::metadata(path).unwrap().is_dir());
1315
+ /// ```
1316
pub fn create<P: AsRef<Path>>(&self, path: P) -> io::Result<()> {
1317
self._create(path.as_ref())
1318
}
0 commit comments