From fd7fd9fa7122b957a6e589021201b0b5192b77f8 Mon Sep 17 00:00:00 2001 From: Davide Ferrero Date: Fri, 24 Nov 2023 12:40:12 +0100 Subject: [PATCH] Upgrade cookie dependency to 0.18 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … and replace uses of the deprecated Cookie::named fn. --- axum-extra/Cargo.toml | 2 +- axum-extra/src/extract/cookie/mod.rs | 4 ++-- axum-extra/src/extract/cookie/private.rs | 2 +- axum-extra/src/extract/cookie/signed.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/axum-extra/Cargo.toml b/axum-extra/Cargo.toml index 68ef5797..bb71d3ab 100644 --- a/axum-extra/Cargo.toml +++ b/axum-extra/Cargo.toml @@ -52,7 +52,7 @@ tower-service = "0.3" # optional dependencies axum-macros = { path = "../axum-macros", version = "0.3.7", optional = true } -cookie = { package = "cookie", version = "0.17", features = ["percent-encode"], optional = true } +cookie = { package = "cookie", version = "0.18.0", features = ["percent-encode"], optional = true } form_urlencoded = { version = "1.1.0", optional = true } headers = { version = "0.3.8", optional = true } multer = { version = "2.0.0", optional = true } diff --git a/axum-extra/src/extract/cookie/mod.rs b/axum-extra/src/extract/cookie/mod.rs index 14dab314..2f2fe135 100644 --- a/axum-extra/src/extract/cookie/mod.rs +++ b/axum-extra/src/extract/cookie/mod.rs @@ -168,7 +168,7 @@ impl CookieJar { /// use axum::response::IntoResponse; /// /// async fn handle(jar: CookieJar) -> CookieJar { - /// jar.remove(Cookie::named("foo")) + /// jar.remove(Cookie::from("foo")) /// } /// ``` #[must_use] @@ -250,7 +250,7 @@ mod tests { } async fn remove_cookie(jar: $jar) -> impl IntoResponse { - jar.remove(Cookie::named("key")) + jar.remove(Cookie::from("key")) } let state = AppState { diff --git a/axum-extra/src/extract/cookie/private.rs b/axum-extra/src/extract/cookie/private.rs index df2c6ae9..837acbe7 100644 --- a/axum-extra/src/extract/cookie/private.rs +++ b/axum-extra/src/extract/cookie/private.rs @@ -216,7 +216,7 @@ impl PrivateCookieJar { /// use axum::response::IntoResponse; /// /// async fn handle(jar: PrivateCookieJar) -> PrivateCookieJar { - /// jar.remove(Cookie::named("foo")) + /// jar.remove(Cookie::from("foo")) /// } /// ``` #[must_use] diff --git a/axum-extra/src/extract/cookie/signed.rs b/axum-extra/src/extract/cookie/signed.rs index 1489d271..5704f2fc 100644 --- a/axum-extra/src/extract/cookie/signed.rs +++ b/axum-extra/src/extract/cookie/signed.rs @@ -234,7 +234,7 @@ impl SignedCookieJar { /// use axum::response::IntoResponse; /// /// async fn handle(jar: SignedCookieJar) -> SignedCookieJar { - /// jar.remove(Cookie::named("foo")) + /// jar.remove(Cookie::from("foo")) /// } /// ``` #[must_use]