diff --git a/axum-extra/CHANGELOG.md b/axum-extra/CHANGELOG.md index a3d22dff..b89c7279 100644 --- a/axum-extra/CHANGELOG.md +++ b/axum-extra/CHANGELOG.md @@ -12,10 +12,12 @@ and this project adheres to [Semantic Versioning]. - **added:** `Clone` implementation for `ErasedJson` ([#2142]) - **breaking:** Update to prost 0.12. Used for the `Protobuf` extractor - **breaking:** Make `tokio` an optional dependency +- **breaking**: Functions and methods that previously accepted a `Cookie` now accept any `T: Into` ([#2348]) [#1850]: https://github.com/tokio-rs/axum/pull/1850 [#2142]: https://github.com/tokio-rs/axum/pull/2142 [#2310]: https://github.com/tokio-rs/axum/pull/2310 +[#2348]: https://github.com/tokio-rs/axum/pull/2348 # 0.7.4 (18. April, 2023) diff --git a/axum-extra/src/extract/cookie/mod.rs b/axum-extra/src/extract/cookie/mod.rs index 2f2fe135..efd2dcdf 100644 --- a/axum-extra/src/extract/cookie/mod.rs +++ b/axum-extra/src/extract/cookie/mod.rs @@ -172,7 +172,7 @@ impl CookieJar { /// } /// ``` #[must_use] - pub fn remove(mut self, cookie: Cookie<'static>) -> Self { + pub fn remove>>(mut self, cookie: C) -> Self { self.jar.remove(cookie); self } @@ -193,7 +193,7 @@ impl CookieJar { /// ``` #[must_use] #[allow(clippy::should_implement_trait)] - pub fn add(mut self, cookie: Cookie<'static>) -> Self { + pub fn add>>(mut self, cookie: C) -> Self { self.jar.add(cookie); self } diff --git a/axum-extra/src/extract/cookie/private.rs b/axum-extra/src/extract/cookie/private.rs index 837acbe7..911b0ef2 100644 --- a/axum-extra/src/extract/cookie/private.rs +++ b/axum-extra/src/extract/cookie/private.rs @@ -220,7 +220,7 @@ impl PrivateCookieJar { /// } /// ``` #[must_use] - pub fn remove(mut self, cookie: Cookie<'static>) -> Self { + pub fn remove>>(mut self, cookie: C) -> Self { self.private_jar_mut().remove(cookie); self } @@ -241,7 +241,7 @@ impl PrivateCookieJar { /// ``` #[must_use] #[allow(clippy::should_implement_trait)] - pub fn add(mut self, cookie: Cookie<'static>) -> Self { + pub fn add>>(mut self, cookie: C) -> Self { self.private_jar_mut().add(cookie); self } diff --git a/axum-extra/src/extract/cookie/signed.rs b/axum-extra/src/extract/cookie/signed.rs index 5704f2fc..b65df79f 100644 --- a/axum-extra/src/extract/cookie/signed.rs +++ b/axum-extra/src/extract/cookie/signed.rs @@ -238,7 +238,7 @@ impl SignedCookieJar { /// } /// ``` #[must_use] - pub fn remove(mut self, cookie: Cookie<'static>) -> Self { + pub fn remove>>(mut self, cookie: C) -> Self { self.signed_jar_mut().remove(cookie); self } @@ -259,7 +259,7 @@ impl SignedCookieJar { /// ``` #[must_use] #[allow(clippy::should_implement_trait)] - pub fn add(mut self, cookie: Cookie<'static>) -> Self { + pub fn add>>(mut self, cookie: C) -> Self { self.signed_jar_mut().add(cookie); self }