File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,7 @@ use sync::atomic;
26
26
///
27
27
/// # Examples
28
28
///
29
- /// ```
30
- /// # fn main() {}
31
- /// # fn foo () {
29
+ /// ```no_run
32
30
/// use std::io::TempDir;
33
31
///
34
32
/// {
@@ -41,7 +39,7 @@ use sync::atomic;
41
39
/// // get the path of the temporary directory without affecting the wrapper
42
40
/// let tmppath = tmpdir.path();
43
41
///
44
- /// println!("The path of temporary directory is {}", tmppath.as_str().unwrap ());
42
+ /// println!("The path of temporary directory is {}", tmppath.display ());
45
43
///
46
44
/// // the temporary directory is automatically removed when tmpdir goes
47
45
/// // out of scope at the end of the block
@@ -56,7 +54,7 @@ use sync::atomic;
56
54
/// // get the path of the temporary directory and disable automatic deletion in the wrapper
57
55
/// let tmppath = tmpdir.into_inner();
58
56
///
59
- /// println!("The path of the not-so-temporary directory is {}", tmppath.as_str().unwrap ());
57
+ /// println!("The path of the not-so-temporary directory is {}", tmppath.display ());
60
58
///
61
59
/// // the temporary directory is not removed here
62
60
/// // because the directory is detached from the wrapper
@@ -74,7 +72,6 @@ use sync::atomic;
74
72
/// Err(e) => panic!("couldn't remove temporary directory: {}", e)
75
73
/// };
76
74
/// }
77
- /// # }
78
75
/// ```
79
76
pub struct TempDir {
80
77
path : Option < Path > ,
You can’t perform that action at this time.
0 commit comments