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:
parent
18f94fa8b5
commit
105932706d
@ -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())
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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())
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user