diff --git a/tower/src/limit/rate/rate.rs b/tower/src/limit/rate/rate.rs index 6c54c14fc..66736deaa 100644 --- a/tower/src/limit/rate/rate.rs +++ b/tower/src/limit/rate/rate.rs @@ -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 } }