Skip to content

unbreak freebsd/openbsd/bitrig build after #23316 #23396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libstd/sys/unix/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
if err != 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
Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(v)))
Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(v)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future reference (I only discovered this recently!) this can also be replaced by PathBuf::new(OsString::from_vec(v)) which removes the need for type ascription :)

}
}

Expand All @@ -232,7 +232,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
Err(io::Error::last_os_error())
} else {
let vec = CStr::from_ptr(v).to_bytes().to_vec();
Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(vec)))
Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(vec)))
}
}
}
Expand Down