Skip to content

Commit

Permalink
Merge pull request #191 from Stebalien/doc/fix-tempdir-in-docs
Browse files Browse the repository at this point in the history
doc: fix tempdir_in documentation
  • Loading branch information
Stebalien authored Aug 22, 2022
2 parents b6b2b35 + 89f4d2d commit 8d50620
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ pub fn tempdir() -> io::Result<TempDir> {
TempDir::new()
}

/// Create a new temporary directory.
/// Create a new temporary directory in a specific directory.
///
/// The `tempdir` function creates a directory in the file system
/// The `tempdir_in` function creates a directory in the specified directory
/// and returns a [`TempDir`].
/// The directory will be automatically deleted when the `TempDir`s
/// destructor is run.
Expand All @@ -83,7 +83,7 @@ pub fn tempdir() -> io::Result<TempDir> {
/// # Examples
///
/// ```
/// use tempfile::tempdir;
/// use tempfile::tempdir_in;
/// use std::fs::File;
/// use std::io::{self, Write};
///
Expand All @@ -93,8 +93,8 @@ pub fn tempdir() -> io::Result<TempDir> {
/// # }
/// # }
/// # fn run() -> Result<(), io::Error> {
/// // Create a directory inside of `std::env::temp_dir()`,
/// let dir = tempdir()?;
/// // Create a directory inside of the current directory.
/// let dir = tempdir_in(".")?;
///
/// let file_path = dir.path().join("my-temporary-note.txt");
/// let mut file = File::create(file_path)?;
Expand Down

0 comments on commit 8d50620

Please sign in to comment.