]> Untitled Git - lemmy.git/blobdiff - crates/utils/src/rate_limit/rate_limiter.rs
Fix clippy error upper_case_acronyms
[lemmy.git] / crates / utils / src / rate_limit / rate_limiter.rs
index 5bb02f596996fc54d0fed01c35546ee8cb0fbaf3..701d608bfb49b7d5e441c7da90afe34d0a52c327 100644 (file)
@@ -1,4 +1,4 @@
-use crate::{APIError, IPAddr, LemmyError};
+use crate::{ApiError, IpAddr, LemmyError};
 use log::debug;
 use std::{collections::HashMap, time::SystemTime};
 use strum::IntoEnumIterator;
@@ -20,13 +20,13 @@ pub(crate) enum RateLimitType {
 /// Rate limiting based on rate type and IP addr
 #[derive(Debug, Clone)]
 pub struct RateLimiter {
-  buckets: HashMap<RateLimitType, HashMap<IPAddr, RateLimitBucket>>,
+  buckets: HashMap<RateLimitType, HashMap<IpAddr, RateLimitBucket>>,
 }
 
 impl Default for RateLimiter {
   fn default() -> Self {
     Self {
-      buckets: HashMap::<RateLimitType, HashMap<IPAddr, RateLimitBucket>>::new(),
+      buckets: HashMap::<RateLimitType, HashMap<IpAddr, RateLimitBucket>>::new(),
     }
   }
 }
@@ -87,7 +87,7 @@ impl RateLimiter {
             rate_limit.allowance
           );
           Err(
-            APIError {
+            ApiError {
               message: format!(
                 "Too many requests. type: {}, IP: {}, {} per {} seconds",
                 type_.as_ref(),