From bfb11bcffc93ce8a0849a5d72d5f9e11c79e9f43 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 23 Jan 2022 09:58:11 +0530 Subject: fix: nix binary should not be mandatory --- Cargo.lock | 2 +- bin/Cargo.toml | 2 +- bin/src/utils.rs | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe57dc9..0e32f66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -507,7 +507,7 @@ dependencies = [ [[package]] name = "statix" -version = "0.5.0" +version = "0.5.1" dependencies = [ "ariadne", "clap", diff --git a/bin/Cargo.toml b/bin/Cargo.toml index db1151a..90c7081 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "statix" -version = "0.5.0" +version = "0.5.1" edition = "2018" license = "MIT" authors = [ "Akshay " ] diff --git a/bin/src/utils.rs b/bin/src/utils.rs index 1adac4a..d3bff54 100644 --- a/bin/src/utils.rs +++ b/bin/src/utils.rs @@ -25,10 +25,7 @@ pub fn lint_map() -> HashMap>> { pub fn get_version_info() -> Option { use std::process::Command; - let program = Command::new("nix") - .arg("--version") - .output() - .expect("failed to execute"); + let program = Command::new("nix").arg("--version").output().ok()?; std::str::from_utf8(&program.stdout) .ok()? .split(' ') -- cgit v1.2.3