Skip to content

Commit b31bdc1

Browse files
authored
Merge pull request #21088 from osdyne/fix-tool-path
Fix trailing newline in tool_path
2 parents c4b8917 + 11a8e51 commit b31bdc1

File tree

1 file changed

+6
-2
lines changed
  • src/tools/rust-analyzer/crates/project-model/src

1 file changed

+6
-2
lines changed

src/tools/rust-analyzer/crates/project-model/src/sysroot.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,12 @@ impl Sysroot {
192192

193193
cmd.arg("which");
194194
cmd.arg(tool.name());
195-
(|| Some(Utf8PathBuf::from(String::from_utf8(cmd.output().ok()?.stdout).ok()?)))()
196-
.unwrap_or_else(|| Utf8PathBuf::from(tool.name()))
195+
(|| {
196+
Some(Utf8PathBuf::from(
197+
String::from_utf8(cmd.output().ok()?.stdout).ok()?.trim_end(),
198+
))
199+
})()
200+
.unwrap_or_else(|| Utf8PathBuf::from(tool.name()))
197201
}
198202
_ => tool.path(),
199203
}

0 commit comments

Comments
 (0)