1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-01-22 06:45:56 +01:00

chore: address clippy lints

This commit is contained in:
Rob Ede 2024-12-29 16:19:36 +00:00
parent 18f94fa8b5
commit 105932706d
No known key found for this signature in database
GPG Key ID: 97C636207D3EF933
9 changed files with 9 additions and 9 deletions

View File

@ -20,7 +20,7 @@ impl IdentityExt for ServiceRequest {
}
}
impl<'a> IdentityExt for GuardContext<'a> {
impl IdentityExt for GuardContext<'_> {
fn get_identity(&self) -> Result<Identity, GetIdentityError> {
Identity::extract(&self.req_data())
}

View File

@ -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,

View File

@ -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())
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {