From b0fdb0d6e0d712d776e8f77880673c5c9c7b9688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Thu, 9 Jul 2026 09:38:26 +0200 Subject: [PATCH] fix(loc): satisfy newer clippy and stabilise powertest.yaml - remove redundant #[must_use] on Report::languages (double_must_use) - use is_multiple_of in the share-bar renderer (manual_is_multiple_of) - drop a pre-existing needless double-borrow in a view.rs test - reformat the powertest.yaml comment into yamlfmt's fixed-point form (verified stable across repeated yamlfmt runs) --- powertest.yaml | 3 +-- src/loc/mod.rs | 1 - src/options/view.rs | 2 +- src/output/code.rs | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/powertest.yaml b/powertest.yaml index ead68791..9be18d4a 100644 --- a/powertest.yaml +++ b/powertest.yaml @@ -183,8 +183,7 @@ commands: ? - -i - --inode : - ? # so only the bare forms are generated here. - - null # --loc and --code take their mode via `=` only (lines/percent/both), + ? - null # --loc/--code take modes via `=` only, so just the bare forms - --loc : prefix: -l ? - null diff --git a/src/loc/mod.rs b/src/loc/mod.rs index e9710ef8..46b4bdc6 100644 --- a/src/loc/mod.rs +++ b/src/loc/mod.rs @@ -230,7 +230,6 @@ impl Report { } /// The per-language rows, ordered by language name. - #[must_use] pub fn languages(&self) -> impl Iterator { self.languages.values() } diff --git a/src/options/view.rs b/src/options/view.rs index fefd1c48..30dd3286 100644 --- a/src/options/view.rs +++ b/src/options/view.rs @@ -608,7 +608,7 @@ mod tests { #[test] fn deduce_time_types_changed_word() { assert_eq!( - TimeTypes::deduce(&&mock_cli(vec!["--time", "changed"])), + TimeTypes::deduce(&mock_cli(vec!["--time", "changed"])), Ok(TimeTypes { modified: false, changed: true, diff --git a/src/output/code.rs b/src/output/code.rs index 194f9baf..e395a0f7 100644 --- a/src/output/code.rs +++ b/src/output/code.rs @@ -254,7 +254,7 @@ fn bar(value: usize, max: usize) -> String { let units = units.max(1); let mut bar = "█".repeat(units / 8); - if units % 8 > 0 { + if !units.is_multiple_of(8) { bar.push(EIGHTHS[units % 8 - 1]); } bar