From 336a34e52c8b0889180c865b29c89420cd1788dc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 2 Aug 2022 09:03:40 +0200 Subject: [PATCH 1/3] Run clippy only on MSRV This patch reverts the matrix for the clippy job to only run clippy on our MSRV instead of stable, beta and nightly. The recurring issue with this was that lints started failing in PRs that couldn't have been fixed in master yet, because master was never tested with a clippy that new (in case of nightly). 1.56.1 is good enough for now. Signed-off-by: Matthias Beyer --- .github/workflows/msrv.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml index fa9cd472..e0692668 100644 --- a/.github/workflows/msrv.yml +++ b/.github/workflows/msrv.yml @@ -111,12 +111,6 @@ jobs: needs: [check] name: Clippy runs-on: ubuntu-latest - strategy: - matrix: - rust: - - stable - - beta - - nightly steps: - name: Checkout sources uses: actions/checkout@v3.0.2 @@ -124,7 +118,7 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.rust }} + toolchain: 1.56.1 override: true components: clippy From d54986c54091e4620c199d3dfadde80b82958bb3 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 2 Aug 2022 09:12:15 +0200 Subject: [PATCH 2/3] Fix: Use float_cmp for testing floats Signed-off-by: Matthias Beyer --- tests/env.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/env.rs b/tests/env.rs index 2ee67de5..3a24bde5 100644 --- a/tests/env.rs +++ b/tests/env.rs @@ -191,7 +191,9 @@ fn test_parse_float() { // can't use `matches!` because of float value match config { - TestFloatEnum::Float(TestFloat { float_val }) => assert_eq!(float_val, 42.3), + TestFloatEnum::Float(TestFloat { float_val }) => { + assert!(float_cmp::approx_eq!(f64, float_val, 42.3)) + } } }) } From 518a3cafa1e62ba7405709e5c508247e328e0a18 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 2 Aug 2022 08:54:12 +0200 Subject: [PATCH 3/3] Fix json5 test: Remove artifact character I am not sure what happened that these tests suddenly fail, or where the artifact comes from... Signed-off-by: Matthias Beyer --- tests/file_json5.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/file_json5.rs b/tests/file_json5.rs index 4bc17d71..a1cb7332 100644 --- a/tests/file_json5.rs +++ b/tests/file_json5.rs @@ -84,7 +84,7 @@ fn test_error_parse() { assert_eq!( res.unwrap_err().to_string(), format!( - " --> 2:7\n |\n2 | ok: true␊\n | ^---\n |\n = expected null in {}", + " --> 2:7\n |\n2 | ok: true\n | ^---\n |\n = expected null in {}", path_with_extension.display() ) );