From 5ba9241a31246234f42dcd6a5345a2f38dd170d2 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 21 Aug 2025 00:43:10 +0300 Subject: [PATCH 1/3] fix clippy errors --- src/structs/prompt.rs | 4 ++-- src/structs/prompt_renderer.rs | 4 ++-- src/utils.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/structs/prompt.rs b/src/structs/prompt.rs index 2e93165..06c7718 100644 --- a/src/structs/prompt.rs +++ b/src/structs/prompt.rs @@ -52,13 +52,13 @@ impl Prompt<'_> { /// Result contains `Some(index)` if user hit 'Enter' or `None` if user cancelled with 'Esc' or 'q'. #[inline] pub fn run(&self) -> io::Result> { - self._run(&Term::stderr(), true) + self.run_internal(&Term::stderr(), true) } /// Like `interact` but allows a specific terminal to be set. /// Ignore `clippy::too-many-lines` #[allow(clippy::too_many_lines)] // TODO: refactor - fn _run(&self, term: &Term, allow_quit: bool) -> io::Result> { + fn run_internal(&self, term: &Term, allow_quit: bool) -> io::Result> { // This cursor iterates over the graphemes vec rather than the search term let mut cursor_pos = 0; let mut search_term: Vec = Vec::new(); diff --git a/src/structs/prompt_renderer.rs b/src/structs/prompt_renderer.rs index 499c167..1594793 100644 --- a/src/structs/prompt_renderer.rs +++ b/src/structs/prompt_renderer.rs @@ -164,7 +164,7 @@ impl Theme { char = format!("{}", self.active_item_style.apply_to(c)); } else { char = format!("{c}"); - }; + } output.push_str(&char); } write!(f, "{}", link_with_label(pretty_path(&entry.path), &output))?; @@ -246,7 +246,7 @@ impl<'a> TermRenderer<'a> { f: F, ) -> io::Result<()> { let mut buf = String::new(); - f(self, &mut buf).map_err(|err| io::Error::new(io::ErrorKind::Other, err))?; + f(self, &mut buf).map_err(io::Error::other)?; self.height += buf.chars().filter(|&x| x == '\n').count() + 1; self.term.write_line(&buf) } diff --git a/src/utils.rs b/src/utils.rs index 02c908a..0fbbb47 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -21,7 +21,7 @@ pub fn resolve_lnk(path: &String) -> String { if link.is_err() { err(format!("Failed to read shortcut \"{}\"", pretty_path(path))); - return path.to_string(); + return path.clone(); } let path_to_open = link @@ -31,7 +31,7 @@ pub fn resolve_lnk(path: &String) -> String { .and_then(|link_target| fs::canonicalize(link_target).ok()); path_to_open.map_or_else( - || path.to_string(), + || path.clone(), |path_to_open| path_to_open.to_string_lossy().to_string(), ) } From ddd5f8d0e8df0a6abfa54a9fb371f7142253b52e Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 21 Aug 2025 00:47:13 +0300 Subject: [PATCH 2/3] fmt --- src/structs/prompt.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/structs/prompt.rs b/src/structs/prompt.rs index 06c7718..a471860 100644 --- a/src/structs/prompt.rs +++ b/src/structs/prompt.rs @@ -58,7 +58,11 @@ impl Prompt<'_> { /// Like `interact` but allows a specific terminal to be set. /// Ignore `clippy::too-many-lines` #[allow(clippy::too_many_lines)] // TODO: refactor - fn run_internal(&self, term: &Term, allow_quit: bool) -> io::Result> { + fn run_internal( + &self, + term: &Term, + allow_quit: bool, + ) -> io::Result> { // This cursor iterates over the graphemes vec rather than the search term let mut cursor_pos = 0; let mut search_term: Vec = Vec::new(); From 35dc219695e4e7eb7c764a26fbaf1da7f4608653 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 21 Aug 2025 00:51:30 +0300 Subject: [PATCH 3/3] update upload sarif to v3 --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 267194d..477d9eb 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -44,7 +44,7 @@ jobs: continue-on-error: true - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true