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 ;
@@ -47,6 +46,7 @@ use tokio::sync::Mutex;
4746use tokio:: time:: { sleep, Duration } ;
4847use tracing:: debug;
4948
49+ use super :: routing:: OwnedRoute ;
5050pub use super :: routing:: RatelimitingBucket ;
5151use super :: { HttpError , LightMethod , Request } ;
5252use crate :: internal:: prelude:: * ;
@@ -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 . upgrade_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 . upgrade_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 . upgrade_to_fully_owned_route ( ) ,
384384 global : false ,
385385 } ) ;
386386
0 commit comments