From f8597c3189a09868469f6d30311d552fb7b5f260 Mon Sep 17 00:00:00 2001 From: Adeniyi eniola Date: Sat, 26 Sep 2026 16:35:58 +0100 Subject: [PATCH] Fix #730: Refactor and modularize complex logic in `cargo-budget-report/src/limit_checks.rs` --- cargo-budget-report/src/limit_checks.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cargo-budget-report/src/limit_checks.rs b/cargo-budget-report/src/limit_checks.rs index cc75fe22..4949bfae 100644 --- a/cargo-budget-report/src/limit_checks.rs +++ b/cargo-budget-report/src/limit_checks.rs @@ -1,5 +1,8 @@ #![allow(dead_code)] +//! Modular limit check logic and boundary helpers for cargo-budget-report. + +/// Core bounds checking helper ensuring `value <= max`. fn check_bounds( value: T, max: T, @@ -83,4 +86,10 @@ mod tests { let err = check_cpu_instructions(500, 100).unwrap_err(); assert_eq!(err, "CPU Instructions 500 exceeds limit 100"); } + + #[test] + fn modular_boundary_edge_cases() { + assert!(check_bounds(10u64, 10u64, "Test").is_ok()); + assert!(check_bounds(11u64, 10u64, "Test").is_err()); + } }