From 21413b7eaf843ddc750bf3bc43641229599e6ae5 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 31 Jul 2022 06:14:28 +0100 Subject: [PATCH] remove default feature --- actix-session/Cargo.toml | 2 +- actix-session/src/lib.rs | 3 +++ actix-session/src/storage/cookie.rs | 3 +-- actix-session/src/storage/mod.rs | 1 - actix-session/src/storage/redis_actor.rs | 6 ++++-- actix-session/src/storage/redis_rs.rs | 6 ++++-- actix-session/src/storage/sled.rs | 4 ++-- 7 files changed, 15 insertions(+), 10 deletions(-) diff --git a/actix-session/Cargo.toml b/actix-session/Cargo.toml index 110c63e8c..2772dc063 100644 --- a/actix-session/Cargo.toml +++ b/actix-session/Cargo.toml @@ -21,7 +21,7 @@ name = "actix_session" path = "src/lib.rs" [features] -default = ["sled-session"] +default = [] cookie-session = [] sled-session = ["sled"] redis-actor-session = ["actix-redis", "actix", "futures-core", "rand"] diff --git a/actix-session/src/lib.rs b/actix-session/src/lib.rs index 2fff6ded0..80977a4b5 100644 --- a/actix-session/src/lib.rs +++ b/actix-session/src/lib.rs @@ -159,6 +159,7 @@ pub mod test_helpers { /// Prints name of function it is called in. /// /// Taken from: https://docs.rs/stdext/0.3.1/src/stdext/macros.rs.html + #[allow(unused_macros)] macro_rules! function_name { () => {{ // Okay, this is ugly, I get it. However, this is the best we can get on a stable rust. @@ -171,6 +172,8 @@ pub mod test_helpers { &name[..name.len() - 3] }}; } + + #[allow(unused_imports)] pub(crate) use function_name; /// Generate a random cookie signing/encryption key. diff --git a/actix-session/src/storage/cookie.rs b/actix-session/src/storage/cookie.rs index 728d1524d..58e4f374e 100644 --- a/actix-session/src/storage/cookie.rs +++ b/actix-session/src/storage/cookie.rs @@ -2,8 +2,7 @@ use std::convert::TryInto as _; use actix_web::cookie::time::Duration; -use super::{LoadError, SaveError, SessionKey, SessionState, UpdateError}; -use crate::storage::SessionStore; +use super::{interface::SessionState, LoadError, SaveError, SessionKey, SessionStore, UpdateError}; /// Use the session key, stored in the session cookie, as storage backend for the session state. /// diff --git a/actix-session/src/storage/mod.rs b/actix-session/src/storage/mod.rs index e4d437cd6..d8a02a15b 100644 --- a/actix-session/src/storage/mod.rs +++ b/actix-session/src/storage/mod.rs @@ -3,7 +3,6 @@ mod interface; mod session_key; -pub(crate) use self::interface::SessionState; pub use self::interface::{LoadError, SaveError, SessionStore, UpdateError}; pub use self::session_key::SessionKey; diff --git a/actix-session/src/storage/redis_actor.rs b/actix-session/src/storage/redis_actor.rs index 9a4c824d9..db9c5ad23 100644 --- a/actix-session/src/storage/redis_actor.rs +++ b/actix-session/src/storage/redis_actor.rs @@ -2,8 +2,10 @@ use actix::Addr; use actix_redis::{resp_array, Command, RedisActor, RespValue}; use actix_web::cookie::time::Duration; -use super::{LoadError, SaveError, SessionKey, SessionState, UpdateError}; -use crate::storage::{utils::generate_session_key, SessionStore}; +use super::{ + interface::SessionState, utils::generate_session_key, LoadError, SaveError, SessionKey, + SessionStore, UpdateError, +}; /// Use Redis as session storage backend. /// diff --git a/actix-session/src/storage/redis_rs.rs b/actix-session/src/storage/redis_rs.rs index 77a0b6263..8920cd19d 100644 --- a/actix-session/src/storage/redis_rs.rs +++ b/actix-session/src/storage/redis_rs.rs @@ -4,8 +4,10 @@ use actix_web::cookie::time::Duration; use anyhow::Context as _; use redis::{aio::ConnectionManager, AsyncCommands, Cmd, FromRedisValue, RedisResult, Value}; -use super::{LoadError, SaveError, SessionKey, SessionState, UpdateError}; -use crate::storage::{utils::generate_session_key, SessionStore}; +use super::{ + interface::SessionState, utils::generate_session_key, LoadError, SaveError, SessionKey, + SessionStore, UpdateError, +}; /// Use Redis as session storage backend. /// diff --git a/actix-session/src/storage/sled.rs b/actix-session/src/storage/sled.rs index ebec84986..2e9d5ae9c 100644 --- a/actix-session/src/storage/sled.rs +++ b/actix-session/src/storage/sled.rs @@ -4,8 +4,8 @@ use actix_web::cookie::time::Duration; use async_trait::async_trait; use super::{ - utils::generate_session_key, LoadError, SaveError, SessionKey, SessionState, SessionStore, - UpdateError, + interface::SessionState, utils::generate_session_key, LoadError, SaveError, SessionKey, + SessionStore, UpdateError, }; #[derive(Clone)]