Skip to content
This repository was archived by the owner on Mar 1, 2019. It is now read-only.

Commit 37508ae

Browse files
committed
Simplify sys_root_path()
1 parent c53f644 commit 37508ae

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/loader.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,7 @@ fn sys_root_path() -> PathBuf {
109109
option_env!("SYSROOT")
110110
.map(PathBuf::from)
111111
.or_else(|| {
112-
option_env!("RUSTC").and_then(|rustc| {
113-
Command::new(rustc)
114-
.arg("--print")
115-
.arg("sysroot")
116-
.output()
117-
.ok()
118-
.and_then(|out| String::from_utf8(out.stdout).ok())
119-
.map(|s| PathBuf::from(s.trim()))
120-
})
121-
})
122-
.or_else(|| {
123-
Command::new("rustc")
112+
Command::new(option_env!("RUSTC").unwrap_or("rustc"))
124113
.arg("--print")
125114
.arg("sysroot")
126115
.output()

0 commit comments

Comments
 (0)