diff --git a/actix-redis/Cargo.toml b/actix-redis/Cargo.toml index ce8a44109..3275b2afa 100644 --- a/actix-redis/Cargo.toml +++ b/actix-redis/Cargo.toml @@ -43,10 +43,9 @@ actix-http = { version = "2.0.0-alpha.3", optional = true } actix-service = { version = "1.0.0", optional = true } actix-session = { version = "0.4.0-alpha.1", optional = true } rand = { version = "0.7.0", optional = true } -serde = { version = "1.0.101", optional = true, features = ["derive"] } +serde = { version = "1.0.101", optional = true } serde_json = { version = "1.0.40", optional = true } [dev-dependencies] env_logger = "0.7" serde_derive = "1.0" -serde_json = "1.0" diff --git a/actix-redis/examples/authentication.rs b/actix-redis/examples/authentication.rs index a34b55309..191288bab 100644 --- a/actix-redis/examples/authentication.rs +++ b/actix-redis/examples/authentication.rs @@ -1,11 +1,9 @@ -#[macro_use] -extern crate serde_derive; - use actix_redis::RedisSession; use actix_session::Session; use actix_web::{ cookie, middleware, web, App, Error, HttpResponse, HttpServer, Responder, }; +use serde::{Deserialize, Serialize}; #[derive(Deserialize)] struct Credentials { diff --git a/actix-redis/src/lib.rs b/actix-redis/src/lib.rs index 5ee762010..af812581c 100644 --- a/actix-redis/src/lib.rs +++ b/actix-redis/src/lib.rs @@ -5,18 +5,12 @@ //! * [API Documentation (Releases)](https://docs.rs/actix-redis/) //! * [Chat on gitter](https://gitter.im/actix/actix) //! * Cargo package: [actix-redis](https://crates.io/crates/actix-redis) -//! * Minimum supported Rust version: 1.26 or later -//! -#[macro_use] -extern crate log; -#[macro_use] -extern crate redis_async; -#[macro_use] -extern crate derive_more; - +//! * Minimum supported Rust version: 1.40.0 or later mod redis; pub use redis::{Command, RedisActor}; +use derive_more::{Display, From}; + #[cfg(feature = "web")] mod session; #[cfg(feature = "web")] diff --git a/actix-redis/src/redis.rs b/actix-redis/src/redis.rs index c60f84119..0b54b95c5 100644 --- a/actix-redis/src/redis.rs +++ b/actix-redis/src/redis.rs @@ -7,6 +7,7 @@ use actix_utils::oneshot; use backoff::backoff::Backoff; use backoff::ExponentialBackoff; use futures_util::FutureExt; +use log::{error, info, warn}; use redis_async::error::Error as RespError; use redis_async::resp::{RespCodec, RespValue}; use tokio::io::{split, WriteHalf}; diff --git a/actix-redis/src/session.rs b/actix-redis/src/session.rs index 0a2c78000..80320f4ad 100644 --- a/actix-redis/src/session.rs +++ b/actix-redis/src/session.rs @@ -13,6 +13,7 @@ use actix_web::{error, Error, HttpMessage}; use futures_util::future::{ok, Future, Ready}; use rand::{distributions::Alphanumeric, rngs::OsRng, Rng}; use redis_async::resp::RespValue; +use redis_async::resp_array; use time::{self, Duration, OffsetDateTime}; use crate::redis::{Command, RedisActor};