Unify temp path generation for non-android

This commit is contained in:
Dennis Duda 2020-05-28 10:04:43 +02:00
parent a367956100
commit 41d540fcb7

View File

@ -83,12 +83,12 @@ fn main() {
};
let listener = t!(TcpListener::bind(bind_addr));
let work: PathBuf = if cfg!(windows) {
env::var_os("RUST_TEMP").expect("Set RUST_TEMP to your preferred temp folder").into()
} else if cfg!(target_os = "android") {
let work: PathBuf = if cfg!(target_os = "android") {
"/data/tmp/work".into()
} else {
"/tmp/work".into()
let mut temp_dir = env::temp_dir();
temp_dir.push("work");
temp_dir
};
println!("listening!");