From 72147659b9c0b0677aac368ece0fff85e89855f7 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 4 Aug 2026 10:10:46 +0100 Subject: [PATCH 1/8] fix: add rust-version to Cargo.toml --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 7b343d5f..93add029 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,7 @@ version = "0.10.0" homepage = "https://github.com/uutils/findutils" repository = "https://github.com/uutils/findutils" edition = "2021" +rust-version = "1.88.0" license = "MIT" readme = "README.md" description = "Rust implementation of GNU findutils" From 3e81fd58597ccc3faf3d7652a14c1fafdef3b0dd Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:17:04 +0100 Subject: [PATCH 2/8] ci: update workflows to run on multiple os and rust-version --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a42df3d2..140e7c0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] + rust: + - 1.88.0 + - stable steps: - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} # For bindgen: https://github.com/rust-lang/rust-bindgen/issues/1797 - uses: KyleMayes/install-llvm-action@v2 if: matrix.os == 'windows-latest' @@ -32,9 +38,15 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] + rust: + - 1.88.0 + - stable steps: - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} # For bindgen: https://github.com/rust-lang/rust-bindgen/issues/1797 - uses: KyleMayes/install-llvm-action@v2 if: matrix.os == 'windows-latest' @@ -58,10 +70,20 @@ jobs: cargo fmt --all -- --check clippy: - name: cargo clippy -- -D warnings - runs-on: ubuntu-latest + name: cargo clippy + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + rust: + - 1.88.0 + - stable steps: - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + components: clippy - run: | cargo clippy --all-targets -- -D warnings From c2c5b395a38094ac93a10c44d02aa5932af045cd Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:46:35 +0100 Subject: [PATCH 3/8] clippy: fix needless_borrows_for_generic_args lint https://rust-lang.github.io/rust-clippy/master/#needless_borrows_for_generic_args --- src/updatedb/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/updatedb/mod.rs b/src/updatedb/mod.rs index 4d706ecf..e27c28d7 100644 --- a/src/updatedb/mod.rs +++ b/src/updatedb/mod.rs @@ -366,12 +366,12 @@ fn do_updatedb(args: &[&str]) -> UResult<()> { let frcoder = Frcoder::new(output.as_slice(), config.db_format); writer .write_all(&frcoder.generate_header()) - .map_err(&write_err)?; + .map_err(write_err)?; for v in frcoder { - writer.write_all(v.as_slice()).map_err(&write_err)?; + writer.write_all(v.as_slice()).map_err(write_err)?; } - writer.flush().map_err(&write_err)?; + writer.flush().map_err(write_err)?; Ok(()) } From 8f344b9c6c1625975d7b8abb455d636c3d8e71c3 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:47:15 +0100 Subject: [PATCH 4/8] clippy: fix collapsible_else_if lint https://rust-lang.github.io/rust-clippy/master/#collapsible_else_if --- src/locate/mod.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/locate/mod.rs b/src/locate/mod.rs index 06dbb00b..51e89fe8 100644 --- a/src/locate/mod.rs +++ b/src/locate/mod.rs @@ -572,13 +572,11 @@ fn match_entry(entry: &CStr, config: &Config, patterns: &Patterns) -> bool { } else { patterns.all_match(entry.as_ref()) } + } else if has_metachars { + // TODO: parse metacharacters + false } else { - if has_metachars { - // TODO: parse metacharacters - false - } else { - patterns.any_match(entry.as_ref()) - } + patterns.any_match(entry.as_ref()) }; // existence is always checked against the full path, even in `--basename` mode From 0ded45e1535a36e9d6eecf6d9f7ea8b34881ce5c Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:48:27 +0100 Subject: [PATCH 5/8] clippy: fix use_self lint https://rust-lang.github.io/rust-clippy/master/#use_self --- src/xargs/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xargs/mod.rs b/src/xargs/mod.rs index 4dbce3a3..0d632478 100644 --- a/src/xargs/mod.rs +++ b/src/xargs/mod.rs @@ -207,11 +207,11 @@ impl MaxCharsCommandSizeLimiter { } #[cfg(windows)] - fn new_system(_env: &HashMap) -> MaxCharsCommandSizeLimiter { + fn new_system(_env: &HashMap) -> Self { // Taken from the CreateProcess docs. -2 to account for how // std::process unconditionally surrounds the program name with quotes. const MAX_CMDLINE: usize = 32767 - 2; - MaxCharsCommandSizeLimiter::new(MAX_CMDLINE) + Self::new(MAX_CMDLINE) } #[cfg(unix)] From aaa6519279820d7db7873ab0398231a0b9c1afb6 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 15:52:39 +0100 Subject: [PATCH 6/8] clippy: fix single_char_pattern lint https://rust-lang.github.io/rust-clippy/master/#single_char_pattern --- src/find/matchers/path.rs | 2 +- src/find/matchers/regex.rs | 2 +- src/find/mod.rs | 2 +- tests/common/test_helpers.rs | 2 +- tests/test_find.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/find/matchers/path.rs b/src/find/matchers/path.rs index c9db3498..f3d00093 100644 --- a/src/find/matchers/path.rs +++ b/src/find/matchers/path.rs @@ -37,7 +37,7 @@ mod tests { // being in a glob. #[cfg(windows)] fn fix_up_glob_slashes(re: &str) -> String { - re.replace("/", "\\\\") + re.replace('/', "\\\\") } #[cfg(not(windows))] diff --git a/src/find/matchers/regex.rs b/src/find/matchers/regex.rs index 4b85e4d5..cf87f960 100644 --- a/src/find/matchers/regex.rs +++ b/src/find/matchers/regex.rs @@ -126,7 +126,7 @@ mod tests { // being in a regex. #[cfg(windows)] fn fix_up_regex_slashes(re: &str) -> String { - re.replace("/", r"\\") + re.replace('/', r"\\") } #[cfg(not(windows))] diff --git a/src/find/mod.rs b/src/find/mod.rs index ff047c82..6d186b66 100644 --- a/src/find/mod.rs +++ b/src/find/mod.rs @@ -522,7 +522,7 @@ mod tests { #[cfg(windows)] /// Windows-only bodge for converting between path separators. pub fn fix_up_slashes(path: &str) -> String { - path.replace("/", "\\") + path.replace('/', "\\") } #[cfg(not(windows))] diff --git a/tests/common/test_helpers.rs b/tests/common/test_helpers.rs index acf5a526..a1cf9d8c 100644 --- a/tests/common/test_helpers.rs +++ b/tests/common/test_helpers.rs @@ -90,7 +90,7 @@ pub fn path_to_testing_commandline() -> String { /// TODO: find out how to share #[cfg(test)] functions/structs between unit /// and integration tests. pub fn fix_up_slashes(path: &str) -> String { - path.replace("/", "\\") + path.replace('/', "\\") } #[cfg(not(windows))] diff --git a/tests/test_find.rs b/tests/test_find.rs index 5af44364..d47d125e 100644 --- a/tests/test_find.rs +++ b/tests/test_find.rs @@ -37,7 +37,7 @@ fn ucmd() -> uutests::util::UCommand { // use in a regex. #[cfg(windows)] fn fix_up_regex_slashes(re: &str) -> String { - re.replace("/", "\\\\") + re.replace('/', "\\\\") } #[cfg(not(windows))] From 504048beaeff2462d94a546494dd221a33ded349 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 16:01:45 +0100 Subject: [PATCH 7/8] fix: dead_code lint --- src/find/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/find/mod.rs b/src/find/mod.rs index 6d186b66..e1c7d17e 100644 --- a/src/find/mod.rs +++ b/src/find/mod.rs @@ -566,6 +566,7 @@ mod tests { } /// Queue a response to be returned by the next call to confirm(). + #[cfg(unix)] pub fn push_confirm_response(&self, response: bool) { self.confirm_responses.borrow_mut().push_back(response); } From a8563b83fff48beb458b26392c726c05b4f12d46 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Fri, 7 Aug 2026 16:03:30 +0100 Subject: [PATCH 8/8] clippy: fix let_unit_value lint https://rust-lang.github.io/rust-clippy/master/#let_unit_value --- src/find/matchers/type_matcher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/find/matchers/type_matcher.rs b/src/find/matchers/type_matcher.rs index a1af4889..1b7679a6 100644 --- a/src/find/matchers/type_matcher.rs +++ b/src/find/matchers/type_matcher.rs @@ -186,7 +186,7 @@ mod tests { } }; #[cfg(windows)] - let _ = { + { if let Err(e) = symlink_file("abbbc", "test_data/links/link-f") { assert!( e.kind() == ErrorKind::AlreadyExists,