From 89f4d2d60c160b4bf2bb8f4e384cda9754dc58c6 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 22 Aug 2022 02:25:10 -0700 Subject: [PATCH] doc: fix tempdir_in documentation fixes #190 --- src/dir.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dir.rs b/src/dir.rs index 2ecea2b9a..73faeecc5 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -65,9 +65,9 @@ pub fn tempdir() -> io::Result { 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. @@ -83,7 +83,7 @@ pub fn tempdir() -> io::Result { /// # Examples /// /// ``` -/// use tempfile::tempdir; +/// use tempfile::tempdir_in; /// use std::fs::File; /// use std::io::{self, Write}; /// @@ -93,8 +93,8 @@ pub fn tempdir() -> io::Result { /// # } /// # } /// # 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)?;