From f2b53bcc41d3f92adab1e8313d4ed1c8f40b0528 Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Wed, 20 Mar 2024 00:10:09 +0530 Subject: [PATCH] fix: trim the version string --- crates/nix_health/src/check/direnv.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/nix_health/src/check/direnv.rs b/crates/nix_health/src/check/direnv.rs index 7f33e482..18ec27b2 100644 --- a/crates/nix_health/src/check/direnv.rs +++ b/crates/nix_health/src/check/direnv.rs @@ -155,7 +155,8 @@ fn direnv_version() -> anyhow::Result { .output()?; if output.status.success() { let out = String::from_utf8_lossy(&output.stdout); - Ok(out.to_string()) + let trimmed_out = out.trim(); + Ok(trimmed_out.to_string()) } else { anyhow::bail!("Unable to run direnv --version: {:?}", output.stderr) }