diff --git a/actix-identity/src/identity_ext.rs b/actix-identity/src/identity_ext.rs index 8c4bbad69..7e71722d2 100644 --- a/actix-identity/src/identity_ext.rs +++ b/actix-identity/src/identity_ext.rs @@ -20,7 +20,7 @@ impl IdentityExt for ServiceRequest { } } -impl<'a> IdentityExt for GuardContext<'a> { +impl IdentityExt for GuardContext<'_> { fn get_identity(&self) -> Result { Identity::extract(&self.req_data()) } diff --git a/actix-limitation/src/status.rs b/actix-limitation/src/status.rs index e7a61e105..fda06d581 100644 --- a/actix-limitation/src/status.rs +++ b/actix-limitation/src/status.rs @@ -16,7 +16,7 @@ impl Status { /// Constructs status limit status from parts. #[must_use] pub(crate) fn new(count: usize, limit: usize, reset_epoch_utc: usize) -> Self { - let remaining = if count >= limit { 0 } else { limit - count }; + let remaining = limit.saturating_sub(count); Status { limit, diff --git a/actix-session/src/session_ext.rs b/actix-session/src/session_ext.rs index eefdc6f2b..141dea12e 100644 --- a/actix-session/src/session_ext.rs +++ b/actix-session/src/session_ext.rs @@ -31,7 +31,7 @@ impl SessionExt for ServiceResponse { } } -impl<'a> SessionExt for GuardContext<'a> { +impl SessionExt for GuardContext<'_> { fn get_session(&self) -> Session { Session::get_session(&mut self.req_data_mut()) } diff --git a/actix-settings/src/settings/backlog.rs b/actix-settings/src/settings/backlog.rs index 668183d9d..dfe4dfc87 100644 --- a/actix-settings/src/settings/backlog.rs +++ b/actix-settings/src/settings/backlog.rs @@ -43,7 +43,7 @@ impl<'de> de::Deserialize<'de> for Backlog { { struct BacklogVisitor; - impl<'de> de::Visitor<'de> for BacklogVisitor { + impl de::Visitor<'_> for BacklogVisitor { type Value = Backlog; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/actix-settings/src/settings/keep_alive.rs b/actix-settings/src/settings/keep_alive.rs index 1395984ab..386c0a2e3 100644 --- a/actix-settings/src/settings/keep_alive.rs +++ b/actix-settings/src/settings/keep_alive.rs @@ -68,7 +68,7 @@ impl<'de> de::Deserialize<'de> for KeepAlive { { struct KeepAliveVisitor; - impl<'de> de::Visitor<'de> for KeepAliveVisitor { + impl de::Visitor<'_> for KeepAliveVisitor { type Value = KeepAlive; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/actix-settings/src/settings/max_connection_rate.rs b/actix-settings/src/settings/max_connection_rate.rs index 702f093b5..8977c9d94 100644 --- a/actix-settings/src/settings/max_connection_rate.rs +++ b/actix-settings/src/settings/max_connection_rate.rs @@ -40,7 +40,7 @@ impl<'de> de::Deserialize<'de> for MaxConnectionRate { { struct MaxConnectionRateVisitor; - impl<'de> de::Visitor<'de> for MaxConnectionRateVisitor { + impl de::Visitor<'_> for MaxConnectionRateVisitor { type Value = MaxConnectionRate; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/actix-settings/src/settings/max_connections.rs b/actix-settings/src/settings/max_connections.rs index 1bb3dd04e..beb5c22c9 100644 --- a/actix-settings/src/settings/max_connections.rs +++ b/actix-settings/src/settings/max_connections.rs @@ -40,7 +40,7 @@ impl<'de> de::Deserialize<'de> for MaxConnections { { struct MaxConnectionsVisitor; - impl<'de> de::Visitor<'de> for MaxConnectionsVisitor { + impl de::Visitor<'_> for MaxConnectionsVisitor { type Value = MaxConnections; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/actix-settings/src/settings/num_workers.rs b/actix-settings/src/settings/num_workers.rs index 39c1bc32b..3a3963dc0 100644 --- a/actix-settings/src/settings/num_workers.rs +++ b/actix-settings/src/settings/num_workers.rs @@ -39,7 +39,7 @@ impl<'de> de::Deserialize<'de> for NumWorkers { { struct NumWorkersVisitor; - impl<'de> de::Visitor<'de> for NumWorkersVisitor { + impl de::Visitor<'_> for NumWorkersVisitor { type Value = NumWorkers; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/actix-settings/src/settings/timeout.rs b/actix-settings/src/settings/timeout.rs index dff3899d5..5099aac33 100644 --- a/actix-settings/src/settings/timeout.rs +++ b/actix-settings/src/settings/timeout.rs @@ -71,7 +71,7 @@ impl<'de> de::Deserialize<'de> for Timeout { { struct TimeoutVisitor; - impl<'de> de::Visitor<'de> for TimeoutVisitor { + impl de::Visitor<'_> for TimeoutVisitor { type Value = Timeout; fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {