From d0f2075ce950b420f72a4808d95bcff259c43c4b Mon Sep 17 00:00:00 2001 From: Luca Palmieri Date: Mon, 18 Oct 2021 13:03:14 +0100 Subject: [PATCH] Implement `Clone` for `CookieSession`. (#201) --- actix-session/CHANGES.md | 3 +++ actix-session/src/cookie.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/actix-session/CHANGES.md b/actix-session/CHANGES.md index dae19b7cc..981d5624d 100644 --- a/actix-session/CHANGES.md +++ b/actix-session/CHANGES.md @@ -2,6 +2,9 @@ ## Unreleased - 2020-xx-xx * Minimum supported Rust version (MSRV) is now 1.51. +* Impl `Clone` for `CookieSession`. [#201] + +[#201]: https://github.com/actix/actix-extras/pull/201 ## 0.5.0-beta.2 - 2020-06-27 diff --git a/actix-session/src/cookie.rs b/actix-session/src/cookie.rs index 594644de5..3a39bc423 100644 --- a/actix-session/src/cookie.rs +++ b/actix-session/src/cookie.rs @@ -30,11 +30,13 @@ pub enum CookieSessionError { impl ResponseError for CookieSessionError {} +#[derive(Copy, Clone)] enum CookieSecurity { Signed, Private, } +#[derive(Clone)] struct CookieSessionInner { key: Key, security: CookieSecurity, @@ -197,6 +199,7 @@ impl CookieSessionInner { /// .secure(true)) /// .service(web::resource("/").to(|| HttpResponse::Ok())); /// ``` +#[derive(Clone)] pub struct CookieSession(Rc); impl CookieSession {