mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-28 07:20:12 +01:00
axum-extra: Use impl Into<Cookie> (#2348)
This commit is contained in:
parent
2402d4604b
commit
e3d34bb553
4 changed files with 8 additions and 6 deletions
|
@ -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<Cookie>` ([#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)
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ impl CookieJar {
|
|||
/// }
|
||||
/// ```
|
||||
#[must_use]
|
||||
pub fn remove(mut self, cookie: Cookie<'static>) -> Self {
|
||||
pub fn remove<C: Into<Cookie<'static>>>(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<C: Into<Cookie<'static>>>(mut self, cookie: C) -> Self {
|
||||
self.jar.add(cookie);
|
||||
self
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ impl<K> PrivateCookieJar<K> {
|
|||
/// }
|
||||
/// ```
|
||||
#[must_use]
|
||||
pub fn remove(mut self, cookie: Cookie<'static>) -> Self {
|
||||
pub fn remove<C: Into<Cookie<'static>>>(mut self, cookie: C) -> Self {
|
||||
self.private_jar_mut().remove(cookie);
|
||||
self
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ impl<K> PrivateCookieJar<K> {
|
|||
/// ```
|
||||
#[must_use]
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
pub fn add(mut self, cookie: Cookie<'static>) -> Self {
|
||||
pub fn add<C: Into<Cookie<'static>>>(mut self, cookie: C) -> Self {
|
||||
self.private_jar_mut().add(cookie);
|
||||
self
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ impl<K> SignedCookieJar<K> {
|
|||
/// }
|
||||
/// ```
|
||||
#[must_use]
|
||||
pub fn remove(mut self, cookie: Cookie<'static>) -> Self {
|
||||
pub fn remove<C: Into<Cookie<'static>>>(mut self, cookie: C) -> Self {
|
||||
self.signed_jar_mut().remove(cookie);
|
||||
self
|
||||
}
|
||||
|
@ -259,7 +259,7 @@ impl<K> SignedCookieJar<K> {
|
|||
/// ```
|
||||
#[must_use]
|
||||
#[allow(clippy::should_implement_trait)]
|
||||
pub fn add(mut self, cookie: Cookie<'static>) -> Self {
|
||||
pub fn add<C: Into<Cookie<'static>>>(mut self, cookie: C) -> Self {
|
||||
self.signed_jar_mut().add(cookie);
|
||||
self
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue