Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jan 4, 2024
1 parent b694c93 commit 77b8dcd
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 25 deletions.
4 changes: 2 additions & 2 deletions actix-cors/src/builder.rs
Original file line number Diff line number Diff line change
@@ -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_web::{
Expand Down Expand Up @@ -610,7 +610,7 @@ where

#[cfg(test)]
mod test {
use std::convert::{Infallible, TryInto};
use std::convert::Infallible;

use actix_web::{
body,
Expand Down
10 changes: 5 additions & 5 deletions actix-cors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ mod error;
mod inner;
mod middleware;

use all_or_some::AllOrSome;
pub use builder::Cors;
pub use error::CorsError;
use inner::{Inner, OriginFn};
pub use middleware::CorsMiddleware;
use crate::{
all_or_some::AllOrSome,
inner::{Inner, OriginFn},
};
pub use crate::{builder::Cors, error::CorsError, middleware::CorsMiddleware};
2 changes: 1 addition & 1 deletion actix-limitation/src/status.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{convert::TryInto, ops::Add, time::Duration};
use std::{ops::Add, time::Duration};

use chrono::SubsecRound as _;

Expand Down
2 changes: 1 addition & 1 deletion actix-session/src/middleware.rs
Original file line number Diff line number Diff line change
@@ -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_web::{
Expand Down
2 changes: 0 additions & 2 deletions actix-session/src/storage/cookie.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryInto;

use actix_web::cookie::time::Duration;
use anyhow::Error;

Expand Down
11 changes: 3 additions & 8 deletions actix-session/src/storage/redis_rs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{convert::TryInto, sync::Arc};
use std::sync::Arc;

use actix_web::cookie::time::Duration;
use anyhow::{Context, Error};
use anyhow::Error;
use redis::{aio::ConnectionManager, AsyncCommands, Cmd, FromRedisValue, RedisResult, Value};

use super::SessionKey;
Expand Down Expand Up @@ -226,12 +226,7 @@ impl SessionStore for RedisSessionStore {

self.client
.clone()
.expire(
&cache_key,
ttl.whole_seconds().try_into().context(
"Failed to convert the state TTL into the number of whole seconds remaining",
)?,
)
.expire(&cache_key, ttl.whole_seconds())
.await?;
Ok(())
}
Expand Down
3 changes: 0 additions & 3 deletions actix-session/src/storage/session_key.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryFrom;

use derive_more::{Display, From};

/// A session key, the string stored in a client-side cookie to associate a user with its session
Expand All @@ -10,7 +8,6 @@ use derive_more::{Display, From};
/// required to be smaller than 4064 bytes.
///
/// ```rust
/// # use std::convert::TryInto;
/// use actix_session::storage::SessionKey;
///
/// let key: String = std::iter::repeat('a').take(4065).collect();
Expand Down
2 changes: 0 additions & 2 deletions actix-session/src/storage/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::convert::TryInto;

use rand::{distributions::Alphanumeric, rngs::OsRng, Rng as _};

use crate::storage::SessionKey;
Expand Down
2 changes: 1 addition & 1 deletion actix-session/tests/opaque_errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, convert::TryInto};
use std::collections::HashMap;

use actix_session::{
storage::{LoadError, SaveError, SessionKey, SessionStore, UpdateError},
Expand Down

0 comments on commit 77b8dcd

Please sign in to comment.