From 933bea7858deb96d5eecc6b2e518316042c48f40 Mon Sep 17 00:00:00 2001 From: Toby Lawrence Date: Sat, 20 Jul 2024 12:04:43 -0400 Subject: [PATCH] Change the assert to use an MSRV-compatible function. --- tower/src/limit/rate/rate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 } }