Skip to content

Commit 8b820b1

Browse files
Potential fixes for 2 code quality findings (#117)
* Apply suggested fix to src/store/weight.rs from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Apply suggested fix to src/store/weight.rs from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 68251c7 commit 8b820b1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/store/weight.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,7 @@ where
811811
///
812812
/// `total_weight` is reset *before* dropping the map contents so that
813813
/// under `panic = "unwind"` a panicking `V::Drop` still leaves the
814-
/// store in a self-consistent state (`map.len() == 0`, the hashbrown
815-
/// `ClearOnDrop` guard guarantees this; `total_weight == 0`).
814+
/// store in a self-consistent state (`map.len() == 0`; `total_weight == 0`).
816815
/// Remaining values may leak via the unwinding drop, but no stale
817816
/// weight baseline can inflate future capacity checks.
818817
///
@@ -1159,8 +1158,9 @@ where
11591158
/// Removes all entries and resets total weight.
11601159
///
11611160
/// Acquires write lock. Attributes the cleared entries to the outer
1162-
/// `removes` metric. Inner-store counters are ignored here so the
1163-
/// public metrics surface counts each bulk clear exactly once.
1161+
/// `removes` metric. Inner-store metrics counters are not consulted
1162+
/// here; removal count is derived from `store.map.len()` so the public
1163+
/// metrics surface counts each bulk clear exactly once.
11641164
fn clear(&self) {
11651165
let mut store = self.inner.write();
11661166
let removed = store.map.len() as u64;

0 commit comments

Comments
 (0)