Fix clippy errors

pictrs-no-gzip
Felix Ableitner 3 years ago
parent 3c54b00ffa
commit 625b959eed

@ -18,19 +18,11 @@ pub(crate) enum RateLimitType {
} }
/// Rate limiting based on rate type and IP addr /// Rate limiting based on rate type and IP addr
#[derive(Debug, Clone)] #[derive(Debug, Clone, Default)]
pub struct RateLimiter { 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(),
}
}
}
impl RateLimiter { impl RateLimiter {
fn insert_ip(&mut self, ip: &IpAddr) { fn insert_ip(&mut self, ip: &IpAddr) {
for rate_limit_type in RateLimitType::iter() { for rate_limit_type in RateLimitType::iter() {

@ -114,6 +114,7 @@ pub(crate) struct PictrsResponse {
#[derive(Deserialize, Debug, Clone)] #[derive(Deserialize, Debug, Clone)]
pub(crate) struct PictrsFile { pub(crate) struct PictrsFile {
file: String, file: String,
#[allow(dead_code)]
delete_token: String, delete_token: String,
} }

Loading…
Cancel
Save