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> {
|
fn get_identity(&self) -> Result<Identity, GetIdentityError> {
|
||||||
Identity::extract(&self.req_data())
|
Identity::extract(&self.req_data())
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ impl Status {
|
|||||||
/// Constructs status limit status from parts.
|
/// Constructs status limit status from parts.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub(crate) fn new(count: usize, limit: usize, reset_epoch_utc: usize) -> Self {
|
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 {
|
Status {
|
||||||
limit,
|
limit,
|
||||||
|
@ -31,7 +31,7 @@ impl SessionExt for ServiceResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> SessionExt for GuardContext<'a> {
|
impl SessionExt for GuardContext<'_> {
|
||||||
fn get_session(&self) -> Session {
|
fn get_session(&self) -> Session {
|
||||||
Session::get_session(&mut self.req_data_mut())
|
Session::get_session(&mut self.req_data_mut())
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ impl<'de> de::Deserialize<'de> for Backlog {
|
|||||||
{
|
{
|
||||||
struct BacklogVisitor;
|
struct BacklogVisitor;
|
||||||
|
|
||||||
impl<'de> de::Visitor<'de> for BacklogVisitor {
|
impl de::Visitor<'_> for BacklogVisitor {
|
||||||
type Value = Backlog;
|
type Value = Backlog;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -68,7 +68,7 @@ impl<'de> de::Deserialize<'de> for KeepAlive {
|
|||||||
{
|
{
|
||||||
struct KeepAliveVisitor;
|
struct KeepAliveVisitor;
|
||||||
|
|
||||||
impl<'de> de::Visitor<'de> for KeepAliveVisitor {
|
impl de::Visitor<'_> for KeepAliveVisitor {
|
||||||
type Value = KeepAlive;
|
type Value = KeepAlive;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -40,7 +40,7 @@ impl<'de> de::Deserialize<'de> for MaxConnectionRate {
|
|||||||
{
|
{
|
||||||
struct MaxConnectionRateVisitor;
|
struct MaxConnectionRateVisitor;
|
||||||
|
|
||||||
impl<'de> de::Visitor<'de> for MaxConnectionRateVisitor {
|
impl de::Visitor<'_> for MaxConnectionRateVisitor {
|
||||||
type Value = MaxConnectionRate;
|
type Value = MaxConnectionRate;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -40,7 +40,7 @@ impl<'de> de::Deserialize<'de> for MaxConnections {
|
|||||||
{
|
{
|
||||||
struct MaxConnectionsVisitor;
|
struct MaxConnectionsVisitor;
|
||||||
|
|
||||||
impl<'de> de::Visitor<'de> for MaxConnectionsVisitor {
|
impl de::Visitor<'_> for MaxConnectionsVisitor {
|
||||||
type Value = MaxConnections;
|
type Value = MaxConnections;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -39,7 +39,7 @@ impl<'de> de::Deserialize<'de> for NumWorkers {
|
|||||||
{
|
{
|
||||||
struct NumWorkersVisitor;
|
struct NumWorkersVisitor;
|
||||||
|
|
||||||
impl<'de> de::Visitor<'de> for NumWorkersVisitor {
|
impl de::Visitor<'_> for NumWorkersVisitor {
|
||||||
type Value = NumWorkers;
|
type Value = NumWorkers;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -71,7 +71,7 @@ impl<'de> de::Deserialize<'de> for Timeout {
|
|||||||
{
|
{
|
||||||
struct TimeoutVisitor;
|
struct TimeoutVisitor;
|
||||||
|
|
||||||
impl<'de> de::Visitor<'de> for TimeoutVisitor {
|
impl de::Visitor<'_> for TimeoutVisitor {
|
||||||
type Value = Timeout;
|
type Value = Timeout;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user