From 44b01ccff3d993daae237c75d466050711d06268 Mon Sep 17 00:00:00 2001 From: Craig Disselkoen Date: Wed, 6 May 2020 12:39:11 -0700 Subject: return a PathBuf instead of String --- crates/ra_env/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_env/src') diff --git a/crates/ra_env/src/lib.rs b/crates/ra_env/src/lib.rs index 8d6aa9268..a1c4239be 100644 --- a/crates/ra_env/src/lib.rs +++ b/crates/ra_env/src/lib.rs @@ -4,15 +4,15 @@ use anyhow::{Error, Result}; use std::env; -use std::path::Path; +use std::path::{Path, PathBuf}; use std::process::Command; -/// Return a `String` to use for the given executable. +/// Return a `PathBuf` to use for the given executable. /// /// E.g., `get_path_for_executable("cargo")` may return just `cargo` if that /// gives a valid Cargo executable; or it may return a full path to a valid /// Cargo. -pub fn get_path_for_executable(executable_name: impl AsRef) -> Result { +pub fn get_path_for_executable(executable_name: impl AsRef) -> Result { // The current implementation checks three places for an executable to use: // 1) Appropriate environment variable (erroring if this is set but not a usable executable) // example: for cargo, this checks $CARGO environment variable; for rustc, $RUSTC; etc @@ -25,7 +25,7 @@ pub fn get_path_for_executable(executable_name: impl AsRef) -> Result) -> Result