Skip to content

Commit

Permalink
Auto merge of #30190 - tshepang:dir_builder-example, r=alexcrichton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Dec 4, 2015
2 parents 5854fed + 4463070 commit 4cedff7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libstd/fs.rs
Expand Up @@ -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<P: AsRef<Path>>(&self, path: P) -> io::Result<()> {
self._create(path.as_ref())
}
Expand Down

0 comments on commit 4cedff7

Please sign in to comment.