about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorelszben <notgonna@tellyou>2014-12-17 07:21:29 +0100
committerelszben <notgonna@tellyou>2014-12-17 07:21:29 +0100
commitc910252769370a1bc039ec25ed918d81669d28ad (patch)
tree45e095c0dc9912dce658be5c421ba7eb2f21246f /src/libstd/io
parentc0e8dc6dce5d847b7bf53b306d6d842e3a223c28 (diff)
downloadrust-c910252769370a1bc039ec25ed918d81669d28ad.tar.gz
rust-c910252769370a1bc039ec25ed918d81669d28ad.zip
Replaced wrapper functions with no_run and as_str().unwrap() with display()
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/tempfile.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libstd/io/tempfile.rs b/src/libstd/io/tempfile.rs
index 334ee9e1e1b..c2b4d5a1fa9 100644
--- a/src/libstd/io/tempfile.rs
+++ b/src/libstd/io/tempfile.rs
@@ -26,9 +26,7 @@ use sync::atomic;
 ///
 /// # Examples
 ///
-/// ```
-/// # fn main() {}
-/// # fn foo () {
+/// ```no_run
 /// use std::io::TempDir;
 ///
 /// {
@@ -41,7 +39,7 @@ use sync::atomic;
 ///     // get the path of the temporary directory without affecting the wrapper
 ///     let tmppath = tmpdir.path();
 ///
-///     println!("The path of temporary directory is {}", tmppath.as_str().unwrap());
+///     println!("The path of temporary directory is {}", tmppath.display());
 ///
 ///     // the temporary directory is automatically removed when tmpdir goes
 ///     // out of scope at the end of the block
@@ -56,7 +54,7 @@ use sync::atomic;
 ///     // get the path of the temporary directory and disable automatic deletion in the wrapper
 ///     let tmppath = tmpdir.into_inner();
 ///
-///     println!("The path of the not-so-temporary directory is {}", tmppath.as_str().unwrap());
+///     println!("The path of the not-so-temporary directory is {}", tmppath.display());
 ///
 ///     // the temporary directory is not removed here
 ///     // because the directory is detached from the wrapper
@@ -74,7 +72,6 @@ use sync::atomic;
 ///         Err(e) => panic!("couldn't remove temporary directory: {}", e)
 ///     };
 /// }
-/// # }
 /// ```
 pub struct TempDir {
     path: Option<Path>,