mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
ensure the parent path's existence on x install
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
@@ -46,10 +46,10 @@ fn change_drive(s: &str) -> Option<String> {
|
||||
}
|
||||
|
||||
fn is_dir_writable_for_user(dir: &PathBuf) -> bool {
|
||||
let tmp_file = dir.join(".tmp");
|
||||
match fs::File::create(&tmp_file) {
|
||||
let tmp = dir.join(".tmp");
|
||||
match fs::create_dir_all(&tmp) {
|
||||
Ok(_) => {
|
||||
fs::remove_file(tmp_file).unwrap();
|
||||
fs::remove_dir_all(tmp).unwrap();
|
||||
true
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
Reference in New Issue
Block a user