Skip to content

Commit

Permalink
Change the assert to use an MSRV-compatible function.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobz authored Jul 20, 2024
1 parent 1f6f9d2 commit 933bea7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tower/src/limit/rate/rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl Rate {
/// This function panics if `num` or `per` is 0.
pub const fn new(num: u64, per: Duration) -> Self {
assert!(num > 0);
assert!(!per.is_zero());
assert!(per.as_nanos() > 0);

Rate { num, per }
}
Expand Down

0 comments on commit 933bea7

Please sign in to comment.