Skip to content

Commit

Permalink
Fix reporting of less and GIT_CONFIG_* env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jul 29, 2023
1 parent f52d74c commit 67352ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/subcommands/doctor/git_config_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/subcommands/doctor/less.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand All @@ -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,
}
}

Expand Down

0 comments on commit 67352ff

Please sign in to comment.