From 976514fe2ac84b6869c2faa4549fe0c79502ee1d Mon Sep 17 00:00:00 2001 From: "adinata.wijaya" Date: Fri, 30 Jan 2026 14:45:06 +0100 Subject: [PATCH 1/6] add toolchain stable --- .github/workflows/coverage.yml | 8 ++++---- rust-toolchain.toml | 4 ++++ src/csv/mod.rs | 4 ++-- src/csv/tokenizer/mod.rs | 4 ++-- src/csv/value.rs | 6 +++--- src/lib.rs | 2 +- src/report/mod.rs | 8 ++------ 7 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ec1fb1f..022733e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,10 +9,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install latest nightly + - name: Install latest stable uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: stable override: true components: rustfmt, clippy, llvm-tools-preview @@ -32,8 +32,8 @@ jobs: RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" CARGO_INCREMENTAL: 0 run: | - cargo +nightly build --verbose - cargo +nightly test --verbose + cargo +stable build --verbose + cargo +stable test --verbose grcov . -s . --binary-path ./target/debug/ -t lcov --llvm --branch --ignore-not-existing --ignore="/*" --ignore="target/*" --ignore="tests/*" -o lcov.info - name: Push grcov results to Coveralls via GitHub Action diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..85f3606 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +components = ["rustfmt", "clippy"] +profile = "minimal" diff --git a/src/csv/mod.rs b/src/csv/mod.rs index 9a4485d..89d47d4 100644 --- a/src/csv/mod.rs +++ b/src/csv/mod.rs @@ -313,13 +313,13 @@ impl Table { Ok(Table { columns: cols }) } - pub(crate) fn rows(&self) -> RowIterator { + pub(crate) fn rows(&self) -> RowIterator<'_> { RowIterator { position: self.columns.iter().map(|c| c.rows.iter()).collect(), } } - pub(crate) fn rows_mut(&mut self) -> RowIteratorMut { + pub(crate) fn rows_mut(&mut self) -> RowIteratorMut<'_> { RowIteratorMut { position: self.columns.iter_mut().map(|c| c.rows.iter_mut()).collect(), } diff --git a/src/csv/tokenizer/mod.rs b/src/csv/tokenizer/mod.rs index ee8c1f4..5d8fbca 100644 --- a/src/csv/tokenizer/mod.rs +++ b/src/csv/tokenizer/mod.rs @@ -187,7 +187,7 @@ pub(crate) struct Parser { delimiters: Delimiters, } -fn tokenize(input: &str, field_sep: char) -> Result, Error> { +fn tokenize(input: &str, field_sep: char) -> Result>, Error> { let mut tokens = Vec::new(); let mut pos = 0; while let Some(remainder) = &input.get(pos..) { @@ -228,7 +228,7 @@ fn parse_literal( field_sep: char, remainder: &str, literal_type: LiteralTerminator, -) -> Result<(usize, Token, bool), Error> { +) -> Result<(usize, Token<'_>, bool), Error> { let terminator_len = literal_type.get_char().len_utf8(); let after_first_quote = &remainder[terminator_len..]; let quote_end = diff --git a/src/csv/value.rs b/src/csv/value.rs index e9be707..db70c21 100644 --- a/src/csv/value.rs +++ b/src/csv/value.rs @@ -88,10 +88,10 @@ impl Display for Value { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match &self { Value::Quantity(val) => { - write!(f, "{val}").unwrap(); + let _ = write!(f, "{val}"); } Value::String(val) => { - write!(f, "'{val}'").unwrap(); + let _ = write!(f, "'{val}'"); } } Ok(()) @@ -143,7 +143,7 @@ impl Value { } } - pub fn as_str(&self) -> Cow { + pub fn as_str(&self) -> Cow<'_, str> { match self { Value::String(str) => str.as_str().into(), Value::Quantity(quant) => quant.to_string().into(), diff --git a/src/lib.rs b/src/lib.rs index 103532a..44e6450 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -117,7 +117,7 @@ pub enum ComparisonMode { Directory(DirectoryConfig), } -fn get_file_name(path: &Path) -> Option> { +fn get_file_name(path: &Path) -> Option> { path.file_name().map(|f| f.to_string_lossy()) } diff --git a/src/report/mod.rs b/src/report/mod.rs index 697a347..5abca70 100644 --- a/src/report/mod.rs +++ b/src/report/mod.rs @@ -411,7 +411,7 @@ pub fn write_image_detail( ctx.insert("actual", &actual.as_ref().to_string_lossy()); ctx.insert("nominal", &nominal.as_ref().to_string_lossy()); - fn get_file_name(path: &Path) -> Result, Error> { + fn get_file_name(path: &Path) -> Result, Error> { path.file_name() .map(|f| f.to_string_lossy()) .ok_or_else(|| { @@ -612,11 +612,7 @@ pub fn write_error_detail( errors: &[&String], report_dir: impl AsRef, ) -> Option { - if let Ok(sub_folder) = create_error_detail(nominal, actual, errors, report_dir) { - Some(sub_folder) - } else { - None - } + create_error_detail(nominal, actual, errors, report_dir).ok() } pub(crate) fn create_reports( From e3b7af402ee633e4ef4f0d57db2288d8d63ab401 Mon Sep 17 00:00:00 2001 From: "adinata.wijaya" Date: Fri, 30 Jan 2026 15:01:16 +0100 Subject: [PATCH 2/6] remove -Zpanic_abort_tests -Cpanic=abort from ci --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 022733e..d3f9778 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,7 +29,7 @@ jobs: - name: Run grcov env: PROJECT_NAME: "havocompare" - RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" + RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off" CARGO_INCREMENTAL: 0 run: | cargo +stable build --verbose From d6b28ce0d18b04a2f976bf26bcd8c63e501d2af0 Mon Sep 17 00:00:00 2001 From: "B. Bertram" <220195786+BBertram-hex@users.noreply.github.com> Date: Thu, 5 Feb 2026 14:41:31 +0100 Subject: [PATCH 3/6] git ignores test output and more IDE folders - test results: report/ and png - IDEs: zed and vscode --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 8ff0eb3..846f461 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ /target .idea Cargo.lock +.vscode/ +.zed/ +report/ +*.jpgdiff_image.png From 4e4524ae2fae21cecd42eb94d04e2be32265e035 Mon Sep 17 00:00:00 2001 From: "B. Bertram" <220195786+BBertram-hex@users.noreply.github.com> Date: Mon, 9 Feb 2026 10:32:21 +0100 Subject: [PATCH 4/6] Start 0.9 development, define MSRV --- Cargo.toml | 3 ++- README.md | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9c38cbb..afb12e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,9 @@ description = "A flexible rule-based file and folder comparison tool and crate i repository = "https://github.com/VolumeGraphics/havocompare" homepage = "https://github.com/VolumeGraphics/havocompare" documentation = "https://docs.rs/havocompare" -version = "0.8.0" +version = "0.9.0-alpha.1" edition = "2021" +rust-version = "1.85" license = "MIT" authors = ["Volume Graphics GmbH"] exclude = ["tests/pdf", "tests/integ", "tests/html", "target", "tests/csv", ".github", "test_report"] diff --git a/README.md b/README.md index aac83a6..2f93956 100644 --- a/README.md +++ b/README.md @@ -326,6 +326,13 @@ rules: ## Changelog +### 0.9.0 + +- **Breaking**: Minimum supported Rust version (MSRV) is now 1.85 +- Internal/CI: + - Switch GitHub CI from `nightly` to `stable` Rust toolchain + - Fix clippy warnings for Rust 1.93+ + ### 0.8.0 - Report will always be generated even though compare is failing. From 0e4d4219b94228ba3e9480ac435949e9791d5f89 Mon Sep 17 00:00:00 2001 From: "B. Bertram" <220195786+BBertram-hex@users.noreply.github.com> Date: Mon, 9 Feb 2026 13:52:27 +0100 Subject: [PATCH 5/6] cleanup yaml formatting --- .github/workflows/coverage.yml | 68 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d3f9778..4c4f448 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -4,41 +4,39 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt, clippy, llvm-tools-preview - - - name: Install lcov - run: sudo apt-get install lcov - - - name: install grcov - run: cargo install grcov - - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Run grcov - env: - PROJECT_NAME: "havocompare" - RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off" - CARGO_INCREMENTAL: 0 - run: | - cargo +stable build --verbose - cargo +stable test --verbose - grcov . -s . --binary-path ./target/debug/ -t lcov --llvm --branch --ignore-not-existing --ignore="/*" --ignore="target/*" --ignore="tests/*" -o lcov.info - - - name: Push grcov results to Coveralls via GitHub Action - uses: coverallsapp/github-action@v2 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - file: "lcov.info" - + - uses: actions/checkout@v3 + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: rustfmt, clippy, llvm-tools-preview + + - name: Install lcov + run: sudo apt-get install lcov + + - name: install grcov + run: cargo install grcov + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Run grcov + env: + PROJECT_NAME: "havocompare" + RUSTFLAGS: "-Cinstrument-coverage -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off" + CARGO_INCREMENTAL: 0 + run: | + cargo +stable build --verbose + cargo +stable test --verbose + grcov . -s . --binary-path ./target/debug/ -t lcov --llvm --branch --ignore-not-existing --ignore="/*" --ignore="target/*" --ignore="tests/*" -o lcov.info + + - name: Push grcov results to Coveralls via GitHub Action + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: "lcov.info" From dd555d52157eaa6b2c207de01d414bcef7f91c11 Mon Sep 17 00:00:00 2001 From: "B. Bertram" <220195786+BBertram-hex@users.noreply.github.com> Date: Mon, 9 Feb 2026 14:48:17 +0100 Subject: [PATCH 6/6] modernize dependency actions for coverage workflow - replace discontinued project: actions-rs/toolchain -> dtolnay/rust-toolchain - checkout v4 - remove superfluous 'uses' --- .github/workflows/coverage.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 4c4f448..019fba6 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,12 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install latest stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true components: rustfmt, clippy, llvm-tools-preview - name: Install lcov @@ -21,10 +19,6 @@ jobs: - name: install grcov run: cargo install grcov - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Run grcov env: PROJECT_NAME: "havocompare"