unbreak bitrig/openbsd build after 8389253d
`PathBuf::new` have been changed. Use `PathBuf::from` instead. Apply the same change for freebsd too, while here.
This commit is contained in:
parent
593db005d4
commit
eefb8e2065
1 changed files with 2 additions and 2 deletions
|
@ -206,7 +206,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||||
if err != 0 { return Err(io::Error::last_os_error()); }
|
if err != 0 { return Err(io::Error::last_os_error()); }
|
||||||
if sz == 0 { return Err(io::Error::last_os_error()); }
|
if sz == 0 { return Err(io::Error::last_os_error()); }
|
||||||
v.set_len(sz as uint - 1); // chop off trailing NUL
|
v.set_len(sz as uint - 1); // chop off trailing NUL
|
||||||
Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(v)))
|
Ok(PathBuf::from(OsString::from_vec(v)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||||
Err(io::Error::last_os_error())
|
Err(io::Error::last_os_error())
|
||||||
} else {
|
} else {
|
||||||
let vec = CStr::from_ptr(v).to_bytes().to_vec();
|
let vec = CStr::from_ptr(v).to_bytes().to_vec();
|
||||||
Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(vec)))
|
Ok(PathBuf::from(OsString::from_vec(vec)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue