Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Clone for CookieJar, PrivateCookieJar and SignedCookieJar #1808

Merged
merged 3 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions axum-extra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning].
except that it enforces field exclusivity at runtime instead of compile time,
as this improves usability.

- **added:** Implement `Clone` for `CookieJar`, `PrivateCookieJar` and `SignedCookieJar` ([#1808])

[#1808]: https://github.com/tokio-rs/axum/pull/1808

# 0.6.0 (24. February, 2022)

- **breaking:** Change casing of `ProtoBuf` to `Protobuf` ([#1595])
Expand Down
2 changes: 1 addition & 1 deletion axum-extra/src/extract/cookie/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub use cookie::Key;
/// .route("/me", get(me));
/// # let app: Router = app;
/// ```
#[derive(Debug, Default)]
#[derive(Debug, Default, Clone)]
pub struct CookieJar {
jar: cookie::CookieJar,
}
Expand Down
1 change: 1 addition & 0 deletions axum-extra/src/extract/cookie/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ use std::{convert::Infallible, fmt, marker::PhantomData};
/// }
/// }
/// ```
#[derive(Clone)]
davidpdrsn marked this conversation as resolved.
Show resolved Hide resolved
pub struct PrivateCookieJar<K = Key> {
jar: cookie::CookieJar,
key: Key,
Expand Down
1 change: 1 addition & 0 deletions axum-extra/src/extract/cookie/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ use std::{convert::Infallible, fmt, marker::PhantomData};
/// }
/// }
/// ```
#[derive(Clone)]
pub struct SignedCookieJar<K = Key> {
jar: cookie::CookieJar,
key: Key,
Expand Down