We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 593db00 commit eefb8e2Copy full SHA for eefb8e2
src/libstd/sys/unix/os.rs
@@ -206,7 +206,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
206
if err != 0 { return Err(io::Error::last_os_error()); }
207
if sz == 0 { return Err(io::Error::last_os_error()); }
208
v.set_len(sz as uint - 1); // chop off trailing NUL
209
- Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(v)))
+ Ok(PathBuf::from(OsString::from_vec(v)))
210
}
211
212
@@ -232,7 +232,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
232
Err(io::Error::last_os_error())
233
} else {
234
let vec = CStr::from_ptr(v).to_bytes().to_vec();
235
- Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(vec)))
+ Ok(PathBuf::from(OsString::from_vec(vec)))
236
237
238
0 commit comments