summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Isidoro <denisidoro@users.noreply.github.com>2024-05-06 22:05:49 -0300
committerGitHub <noreply@github.com>2024-05-06 22:05:49 -0300
commit78c5aaf9e0648b4b4db8c07d70dbecbd0f27e061 (patch)
treeba1246119ab9645df4fd19166c0e53ca9c6321ef
parentd713d501a0958e365cff2cebc444385cd549fce1 (diff)
parentd0d56223ce1eb21ae9487bbf676f10ce348071ef (diff)
Merge pull request #892 from tolik518/linter-fix-for-fzf-issue
Fixed failing linter
-rw-r--r--src/clients/tldr.rs2
-rw-r--r--src/config/yaml.rs4
-rw-r--r--src/finder/mod.rs23
3 files changed, 14 insertions, 15 deletions
diff --git a/src/clients/tldr.rs b/src/clients/tldr.rs
index 01cec89..79c56bf 100644
--- a/src/clients/tldr.rs
+++ b/src/clients/tldr.rs
@@ -1,5 +1,5 @@
-use crate::prelude::*;
use crate::config::CONFIG;
+use crate::prelude::*;
use std::process::{Command, Stdio};
lazy_static! {
diff --git a/src/config/yaml.rs b/src/config/yaml.rs
index e0c7e87..6a080bc 100644
--- a/src/config/yaml.rs
+++ b/src/config/yaml.rs
@@ -172,8 +172,6 @@ impl Default for Shell {
impl Default for Client {
fn default() -> Self {
- Self {
- tealdeer: false,
- }
+ Self { tealdeer: false }
}
}
diff --git a/src/finder/mod.rs b/src/finder/mod.rs
index f19f2ca..77d129a 100644
--- a/src/finder/mod.rs
+++ b/src/finder/mod.rs
@@ -52,11 +52,7 @@ fn parse(out: Output, opts: Opts) -> Result<String> {
impl FinderChoice {
fn check_fzf_version() -> Option<(u32, u32, u32)> {
- let output = Command::new("fzf")
- .arg("--version")
- .output()
- .ok()?
- .stdout;
+ let output = Command::new("fzf").arg("--version").output().ok()?.stdout;
let version_string = String::from_utf8(output).ok()?;
let version_parts: Vec<_> = version_string.split('.').collect();
if version_parts.len() == 3 {
@@ -80,12 +76,17 @@ impl FinderChoice {
if let Self::Fzf = self {
if let Some((major, minor, patch)) = Self::check_fzf_version() {
- if major == MIN_FZF_VERSION_MAJOR && minor < MIN_FZF_VERSION_MINOR && patch < MIN_FZF_VERSION_PATCH {
- eprintln!("Warning: Fzf version {}.{} does not support the preview window layout used by navi.", major, minor);
- eprintln!("Consider updating Fzf to a version >= {}.{}.{} or use a compatible layout.",
- MIN_FZF_VERSION_MAJOR,
- MIN_FZF_VERSION_MINOR,
- MIN_FZF_VERSION_PATCH
+ if major == MIN_FZF_VERSION_MAJOR
+ && minor < MIN_FZF_VERSION_MINOR
+ && patch < MIN_FZF_VERSION_PATCH
+ {
+ eprintln!(
+ "Warning: Fzf version {}.{} does not support the preview window layout used by navi.",
+ major, minor
+ );
+ eprintln!(
+ "Consider updating Fzf to a version >= {}.{}.{} or use a compatible layout.",
+ MIN_FZF_VERSION_MAJOR, MIN_FZF_VERSION_MINOR, MIN_FZF_VERSION_PATCH
);
process::exit(1);
}