3535//!
3636//! [Taken from]: https://discord.com/developers/docs/topics/rate-limits#rate-limits
3737
38- use std:: borrow:: Cow ;
3938use std:: fmt;
4039use std:: str:: { self , FromStr } ;
4140use std:: time:: SystemTime ;
@@ -49,6 +48,7 @@ use tracing::debug;
4948
5049pub use super :: routing:: RatelimitingBucket ;
5150use super :: { HttpError , LightMethod , Request } ;
51+ use super :: routing:: OwnedRoute ;
5252use crate :: internal:: prelude:: * ;
5353
5454/// Passed to the [`Ratelimiter::set_ratelimit_callback`] callback. If using Client, that callback
@@ -59,7 +59,7 @@ pub struct RatelimitInfo {
5959 pub timeout : std:: time:: Duration ,
6060 pub limit : i64 ,
6161 pub method : LightMethod ,
62- pub path : Cow < ' static , str > ,
62+ pub route : OwnedRoute ,
6363 pub global : bool ,
6464}
6565
@@ -228,7 +228,7 @@ impl Ratelimiter {
228228 timeout : Duration :: from_secs_f64 ( retry_after) ,
229229 limit : 50 ,
230230 method : req. method ,
231- path : req. route . path ( ) ,
231+ route : req. route . to_fully_owned_route ( ) ,
232232 global : true ,
233233 } ) ;
234234 sleep ( Duration :: from_secs_f64 ( retry_after) ) . await ;
@@ -322,7 +322,7 @@ impl Ratelimit {
322322 timeout : delay,
323323 limit : self . limit ,
324324 method : req. method ,
325- path : req. route . path ( ) ,
325+ route : req. route . to_fully_owned_route ( ) ,
326326 global : false ,
327327 } ) ;
328328
@@ -380,7 +380,7 @@ impl Ratelimit {
380380 timeout : Duration :: from_secs_f64 ( retry_after) ,
381381 limit : self . limit ,
382382 method : req. method ,
383- path : req. route . path ( ) ,
383+ route : req. route . to_fully_owned_route ( ) ,
384384 global : false ,
385385 } ) ;
386386
0 commit comments