mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 14:01:20 -03:00
tempfile: use std::env:temp_dir
This is a more robust implementation of our custom `get_tmpdir`. Closes #12046
This commit is contained in:
committed by
Johannes Altmanninger
parent
f3f231cf70
commit
a56b1099aa
@@ -41,12 +41,8 @@ fn drop(&mut self) {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_tmpdir() -> PathBuf {
|
||||
PathBuf::from(std::env::var_os("TMPDIR").unwrap_or("/tmp".into()))
|
||||
}
|
||||
|
||||
fn get_template() -> PathBuf {
|
||||
get_tmpdir().join("fish_tmp_XXXXXX")
|
||||
std::env::temp_dir().join("fish_tmp_XXXXXX")
|
||||
}
|
||||
|
||||
/// Tries to create a new temporary file using `mkstemp`.
|
||||
|
||||
Reference in New Issue
Block a user