division by zero check to avoid panic #39

Merged
muellerr merged 1 commits from mohr/div_zero into main 2026-02-14 17:45:20 +01:00
Owner

I'd like to compile this crate without any panics, the check will avoid one.

As GlobalTimerCounter::frequency_to_ticks also returns 0 in a failure path, it should be reasonable to return 0 here as well, instead of panicking.

I'd like to compile this crate without any panics, the check will avoid one. As `GlobalTimerCounter::frequency_to_ticks` also returns 0 in a failure path, it should be reasonable to return 0 here as well, instead of panicking.
mohr added 1 commit 2026-02-11 12:47:27 +01:00
division by zero check to avoid panic
ci / Check build (push) Has been cancelled
ci / Check formatting (push) Has been cancelled
ci / Check Documentation Build (push) Has been cancelled
ci / Clippy (push) Has been cancelled
ci / Check build (pull_request) Has been cancelled
ci / Check formatting (pull_request) Has been cancelled
ci / Check Documentation Build (pull_request) Has been cancelled
ci / Clippy (pull_request) Has been cancelled
1abbe7b9c9
mohr requested review from muellerr 2026-02-11 12:47:43 +01:00
muellerr approved these changes 2026-02-14 17:45:06 +01:00
muellerr merged commit 3b23e9be05 into main 2026-02-14 17:45:20 +01:00
muellerr deleted branch mohr/div_zero 2026-02-14 17:45:21 +01:00
Sign in to join this conversation.