From 24f87c1b6ce21822f7d83647b75c232efbda6434 Mon Sep 17 00:00:00 2001 From: maneatingape <44142177+maneatingape@users.noreply.github.com> Date: Sun, 10 Sep 2023 13:22:56 +0200 Subject: [PATCH] Expand Clippy lints to cover tests and conditional features --- .github/workflows/checks.yml | 2 +- tests/year2015/day08_test.rs | 4 ++-- tests/year2022/day17_test.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3aabd4d..d4d628e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,5 +12,5 @@ jobs: steps: - uses: actions/checkout@v3 - run: cargo fmt --check - - run: cargo clippy -- --deny warnings + - run: cargo clippy --tests --all-features -- --deny warnings - run: cargo test diff --git a/tests/year2015/day08_test.rs b/tests/year2015/day08_test.rs index 90aba9a..268f08a 100644 --- a/tests/year2015/day08_test.rs +++ b/tests/year2015/day08_test.rs @@ -9,11 +9,11 @@ const EXAMPLE: &str = r#" #[test] fn part1_test() { let input = parse(EXAMPLE); - assert_eq!(part1(&input), 12); + assert_eq!(part1(input), 12); } #[test] fn part2_test() { let input = parse(EXAMPLE); - assert_eq!(part2(&input), 19); + assert_eq!(part2(input), 19); } diff --git a/tests/year2022/day17_test.rs b/tests/year2022/day17_test.rs index d4d6674..86e1d7e 100644 --- a/tests/year2022/day17_test.rs +++ b/tests/year2022/day17_test.rs @@ -5,11 +5,11 @@ const EXAMPLE: &str = ">>><<><>><<<>><>>><<<>>><<<><<<>><>><<>>"; #[test] fn part1_test() { let input = parse(EXAMPLE); - assert_eq!(part1(&input), 3068); + assert_eq!(part1(input), 3068); } #[test] fn part2_test() { let input = parse(EXAMPLE); - assert_eq!(part2(&input), 1514285714288); + assert_eq!(part2(input), 1514285714288); }