From 7c0743293e5720a5be7b44b4a781b2982d63152a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 23 Jul 2020 18:57:27 +0200 Subject: Require quotes around key-value cfg flags in rust-project.json This matches rustc command-line flags, as well as the build.rs format. --- crates/ra_project_model/src/sysroot.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_project_model/src/sysroot.rs') diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs index 68d134da4..8a92acea5 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/ra_project_model/src/sysroot.rs @@ -6,7 +6,7 @@ use anyhow::{bail, format_err, Result}; use paths::{AbsPath, AbsPathBuf}; use ra_arena::{Arena, Idx}; -use crate::output; +use crate::utf8_stdout; #[derive(Default, Debug, Clone, Eq, PartialEq)] pub struct Sysroot { @@ -92,15 +92,14 @@ fn get_or_install_rust_src(cargo_toml: &AbsPath) -> Result { let current_dir = cargo_toml.parent().unwrap(); let mut rustc = Command::new(ra_toolchain::rustc()); rustc.current_dir(current_dir).args(&["--print", "sysroot"]); - let rustc_output = output(rustc)?; - let stdout = String::from_utf8(rustc_output.stdout)?; + let stdout = utf8_stdout(rustc)?; let sysroot_path = AbsPath::assert(Path::new(stdout.trim())); let src_path = sysroot_path.join("lib/rustlib/src/rust/src"); if !src_path.exists() { let mut rustup = Command::new(ra_toolchain::rustup()); rustup.current_dir(current_dir).args(&["component", "add", "rust-src"]); - let _output = output(rustup)?; + utf8_stdout(rustup)?; } if !src_path.exists() { bail!( -- cgit v1.2.3