This commit is contained in:
Edwin Cheng 2020-04-25 12:48:59 +08:00
parent 3bad5587c8
commit fb996cae6b

View file

@ -199,6 +199,7 @@ impl Expander {
}
}
#[cfg(windows)]
fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
let mut to = std::env::temp_dir();
let file_name = path.file_name().ok_or_else(|| {
@ -212,3 +213,8 @@ fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
std::fs::copy(path, &to)?;
Ok(to)
}
#[cfg(unix)]
fn copy_to_temp_dir(path: &Path) -> io::Result<PathBuf> {
Ok(path.to_path_buf())
}