From 67352ffacc9f22171c50763247db8116af3fc49c Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 29 Jul 2023 14:04:30 -0400 Subject: [PATCH] Fix reporting of less and GIT_CONFIG_* env vars --- src/subcommands/doctor/git_config_env.rs | 8 ++++---- src/subcommands/doctor/less.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/subcommands/doctor/git_config_env.rs b/src/subcommands/doctor/git_config_env.rs index a52be6ea4..7fb205a42 100644 --- a/src/subcommands/doctor/git_config_env.rs +++ b/src/subcommands/doctor/git_config_env.rs @@ -48,12 +48,12 @@ impl Diagnostic for GitConfigEnvVars { } fn diagnose(&self) -> Health { - let diagnosis_is_healthy = self.report(); + let (description, is_healthy) = self.report(); let remedy = "Unset `GIT_CONFIG_*` environment variables.".to_string(); - match diagnosis_is_healthy.1 { - true => Unhealthy(diagnosis_is_healthy.0, remedy), - false => Healthy, + match is_healthy { + false => Unhealthy(description, remedy), + true => Healthy, } } diff --git a/src/subcommands/doctor/less.rs b/src/subcommands/doctor/less.rs index b196d4162..efa1fabb5 100644 --- a/src/subcommands/doctor/less.rs +++ b/src/subcommands/doctor/less.rs @@ -36,8 +36,8 @@ impl Diagnostic for Less { ), Some(n) if n >= self.min_version => ( format!( - "`less` version >= {} is required (your version: {})", - MIN_LESS_VERSION, n + "Your less version ({}) is >= {} as required", + n, self.min_version ), true, ), @@ -46,12 +46,12 @@ impl Diagnostic for Less { } fn diagnose(&self) -> Health { - let diagnosis_is_healthy = self.report(); + let (description, is_healthy) = self.report(); let remedy = format!("Install `less` version >= {}", MIN_LESS_VERSION); - match diagnosis_is_healthy.1 { - true => Unhealthy(diagnosis_is_healthy.0, remedy), - false => Healthy, + match is_healthy { + false => Unhealthy(description, remedy), + true => Healthy, } }