Skip to content

Commit 55bb279

Browse files
committed
test: replace early return with assertion
1 parent 5516d2a commit 55bb279

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/relay/switch/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,7 @@ mod test {
561561

562562
let total_hits = high_activity_hits + low_activity_hits;
563563
// Avoid division by zero if no hits occurred (very unlikely but possible)
564-
if total_hits == 0 {
565-
return;
566-
}
564+
assert!(total_hits > 0, "total hits is zero");
567565

568566
let high_activity_percentage = (high_activity_hits as f64 / total_hits as f64) * 100.0;
569567

0 commit comments

Comments
 (0)