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 11use std:: env;
22use std:: path:: { Path , PathBuf } ;
33
4+ #[ cfg( doc) ]
5+ use crate :: { tempdir_in, tempfile_in, Builder } ;
6+
47// Once rust 1.70 is wide-spread (Debian stable), we can use OnceLock from stdlib.
58use once_cell:: sync:: OnceCell as OnceLock ;
69
@@ -11,6 +14,10 @@ static DEFAULT_TEMPDIR: OnceLock<PathBuf> = OnceLock::new();
1114/// except in exceptional cases where it's not configured correctly by the platform. Applications
1215/// should first check if the path returned by [`env::temp_dir`] is acceptable.
1316///
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+ ///
1421/// Only the first call to this function will succeed. All further calls will fail with `Err(path)`
1522/// where `path` is previously set default temporary directory override.
1623///
You can’t perform that action at this time.
0 commit comments