diff options
author | Michael Davis | 2024-01-23 18:36:53 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2024-01-24 06:47:49 +0000 |
commit | cb25d13028ec1cdf986a3567ea52562ea654a7b8 (patch) | |
tree | a820e7dbceebe37fbfb3897429747ba8bfeb524b /helix-loader/src | |
parent | 6d724a8f331f4b2a8f1a001e990cf6129dc50b00 (diff) |
Improve error handling for `which::which` failures
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
Diffstat (limited to 'helix-loader/src')
-rw-r--r-- | helix-loader/src/grammar.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/helix-loader/src/grammar.rs b/helix-loader/src/grammar.rs index 537e1282..7977c6df 100644 --- a/helix-loader/src/grammar.rs +++ b/helix-loader/src/grammar.rs @@ -86,10 +86,8 @@ pub fn get_language(name: &str) -> Result<Language> { } fn ensure_git_is_available() -> Result<()> { - match helix_stdx::env::which("git") { - Ok(_cmd) => Ok(()), - Err(err) => Err(anyhow::anyhow!("'git' could not be found ({err})")), - } + helix_stdx::env::which("git")?; + Ok(()) } pub fn fetch_grammars() -> Result<()> { |