File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 1
1
use std:: env;
2
2
use std:: path:: { Path , PathBuf } ;
3
3
4
+ #[ cfg( doc) ]
5
+ use crate :: { tempdir_in, tempfile_in, Builder } ;
6
+
4
7
// Once rust 1.70 is wide-spread (Debian stable), we can use OnceLock from stdlib.
5
8
use once_cell:: sync:: OnceCell as OnceLock ;
6
9
@@ -11,6 +14,10 @@ static DEFAULT_TEMPDIR: OnceLock<PathBuf> = OnceLock::new();
11
14
/// except in exceptional cases where it's not configured correctly by the platform. Applications
12
15
/// should first check if the path returned by [`env::temp_dir`] is acceptable.
13
16
///
17
+ /// If you're writing a library and want to control where your temporary files are placed, you
18
+ /// should instead use the `_in` variants of the various temporary file/directory constructors
19
+ /// ([`tempdir_in`], [`tempfile_in`], the so-named functions on [`Builder`], etc.).
20
+ ///
14
21
/// Only the first call to this function will succeed. All further calls will fail with `Err(path)`
15
22
/// where `path` is previously set default temporary directory override.
16
23
///
You can’t perform that action at this time.
0 commit comments