Skip to content

Commit 03b2087

Browse files
committed
Use env::var_os("HOME") rather than env::var("HOME")
Because the value is used to create a Path, there's no reason to go all the way validating it is utf-8 (although in practice, it almost certainly is, but it doesn't even matter).
1 parent 4a49a79 commit 03b2087

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cargo/core/compiler/compilation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'cfg> Compilation<'cfg> {
183183
// These are the defaults when DYLD_FALLBACK_LIBRARY_PATH isn't
184184
// set. Since Cargo is explicitly setting the value, make sure the
185185
// defaults still work.
186-
if let Ok(home) = env::var("HOME") {
186+
if let Some(home) = env::var_os("HOME") {
187187
search_path.push(PathBuf::from(home).join("lib"));
188188
}
189189
search_path.push(PathBuf::from("/usr/local/lib"));

0 commit comments

Comments
 (0)