mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 23:51:06 +01:00
chore: clippy
This commit is contained in:
parent
b694c9317a
commit
77b8dcdf59
@ -1,4 +1,4 @@
|
|||||||
use std::{collections::HashSet, convert::TryInto, iter::FromIterator, rc::Rc};
|
use std::{collections::HashSet, iter::FromIterator, rc::Rc};
|
||||||
|
|
||||||
use actix_utils::future::{self, Ready};
|
use actix_utils::future::{self, Ready};
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
@ -610,7 +610,7 @@ where
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use std::convert::{Infallible, TryInto};
|
use std::convert::Infallible;
|
||||||
|
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
body,
|
body,
|
||||||
|
@ -61,8 +61,8 @@ mod error;
|
|||||||
mod inner;
|
mod inner;
|
||||||
mod middleware;
|
mod middleware;
|
||||||
|
|
||||||
use all_or_some::AllOrSome;
|
use crate::{
|
||||||
pub use builder::Cors;
|
all_or_some::AllOrSome,
|
||||||
pub use error::CorsError;
|
inner::{Inner, OriginFn},
|
||||||
use inner::{Inner, OriginFn};
|
};
|
||||||
pub use middleware::CorsMiddleware;
|
pub use crate::{builder::Cors, error::CorsError, middleware::CorsMiddleware};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use std::{convert::TryInto, ops::Add, time::Duration};
|
use std::{ops::Add, time::Duration};
|
||||||
|
|
||||||
use chrono::SubsecRound as _;
|
use chrono::SubsecRound as _;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use std::{collections::HashMap, convert::TryInto, fmt, future::Future, pin::Pin, rc::Rc};
|
use std::{collections::HashMap, fmt, future::Future, pin::Pin, rc::Rc};
|
||||||
|
|
||||||
use actix_utils::future::{ready, Ready};
|
use actix_utils::future::{ready, Ready};
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use std::convert::TryInto;
|
|
||||||
|
|
||||||
use actix_web::cookie::time::Duration;
|
use actix_web::cookie::time::Duration;
|
||||||
use anyhow::Error;
|
use anyhow::Error;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use std::{convert::TryInto, sync::Arc};
|
use std::sync::Arc;
|
||||||
|
|
||||||
use actix_web::cookie::time::Duration;
|
use actix_web::cookie::time::Duration;
|
||||||
use anyhow::{Context, Error};
|
use anyhow::Error;
|
||||||
use redis::{aio::ConnectionManager, AsyncCommands, Cmd, FromRedisValue, RedisResult, Value};
|
use redis::{aio::ConnectionManager, AsyncCommands, Cmd, FromRedisValue, RedisResult, Value};
|
||||||
|
|
||||||
use super::SessionKey;
|
use super::SessionKey;
|
||||||
@ -226,12 +226,7 @@ impl SessionStore for RedisSessionStore {
|
|||||||
|
|
||||||
self.client
|
self.client
|
||||||
.clone()
|
.clone()
|
||||||
.expire(
|
.expire(&cache_key, ttl.whole_seconds())
|
||||||
&cache_key,
|
|
||||||
ttl.whole_seconds().try_into().context(
|
|
||||||
"Failed to convert the state TTL into the number of whole seconds remaining",
|
|
||||||
)?,
|
|
||||||
)
|
|
||||||
.await?;
|
.await?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use std::convert::TryFrom;
|
|
||||||
|
|
||||||
use derive_more::{Display, From};
|
use derive_more::{Display, From};
|
||||||
|
|
||||||
/// A session key, the string stored in a client-side cookie to associate a user with its session
|
/// A session key, the string stored in a client-side cookie to associate a user with its session
|
||||||
@ -10,7 +8,6 @@ use derive_more::{Display, From};
|
|||||||
/// required to be smaller than 4064 bytes.
|
/// required to be smaller than 4064 bytes.
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// # use std::convert::TryInto;
|
|
||||||
/// use actix_session::storage::SessionKey;
|
/// use actix_session::storage::SessionKey;
|
||||||
///
|
///
|
||||||
/// let key: String = std::iter::repeat('a').take(4065).collect();
|
/// let key: String = std::iter::repeat('a').take(4065).collect();
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use std::convert::TryInto;
|
|
||||||
|
|
||||||
use rand::{distributions::Alphanumeric, rngs::OsRng, Rng as _};
|
use rand::{distributions::Alphanumeric, rngs::OsRng, Rng as _};
|
||||||
|
|
||||||
use crate::storage::SessionKey;
|
use crate::storage::SessionKey;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use std::{collections::HashMap, convert::TryInto};
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use actix_session::{
|
use actix_session::{
|
||||||
storage::{LoadError, SaveError, SessionKey, SessionStore, UpdateError},
|
storage::{LoadError, SaveError, SessionKey, SessionStore, UpdateError},
|
||||||
|
Loading…
Reference in New Issue
Block a user