From 96cb9706f58c1ceeb67dc1c7fbe193449546b126 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Fri, 03 Jan 2025 20:37:42 +0700 Subject: [PATCH] Upgrade to axum 0.8 --- Cargo.lock | 50 ++++++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 3 ++- src/methods/repo/summary.rs | 3 ++- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ed9c71..fece92b 100644 --- a/Cargo.lock +++ a/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -132,13 +132,13 @@ [[package]] name = "axum" -version = "0.7.9" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" dependencies = [ - "async-trait", "axum-core", "bytes", + "form_urlencoded", "futures-util", "http", "http-body", @@ -153,6 +153,7 @@ "pin-project-lite", "rustversion", "serde", + "serde_path_to_error", "serde_urlencoded", "sync_wrapper", "tokio", @@ -163,11 +164,10 @@ [[package]] name = "axum-core" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" dependencies = [ - "async-trait", "bytes", "futures-util", "http", @@ -177,6 +177,27 @@ "pin-project-lite", "rustversion", "sync_wrapper", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-extra" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fc6f625a1f7705c6cf62d0d070794e94668988b1c38111baeec177c715f7b" +dependencies = [ + "axum", + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "serde", + "tower", "tower-layer", "tower-service", ] @@ -2044,9 +2065,9 @@ [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "maybe-async" @@ -2548,6 +2569,7 @@ "arc-swap", "askama", "axum", + "axum-extra", "basic-toml", "bytes", "clap", @@ -2743,6 +2765,16 @@ "proc-macro2", "quote", "syn", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 790d9f9..ae94462 100644 --- a/Cargo.toml +++ a/Cargo.toml @@ -15,11 +15,12 @@ anyhow = "1.0" arc-swap = "1.7" askama = { version = "0.12.0", default-features = false } -axum = { version = "0.7", default-features = false, features = [ +axum = { version = "0.8", default-features = false, features = [ "query", "tokio", "http1", ] } +axum-extra = { version = "0.10", default-features = false } basic-toml = "0.1" bytes = "1.5" clap = { version = "4.5.20", default-features = false, features = [ diff --git a/src/methods/repo/summary.rs b/src/methods/repo/summary.rs index bed632a..62c1f42 100644 --- a/src/methods/repo/summary.rs +++ a/src/methods/repo/summary.rs @@ -1,8 +1,9 @@ use std::{collections::BTreeMap, sync::Arc}; use anyhow::Context; use askama::Template; -use axum::{extract::Host, response::IntoResponse, Extension}; +use axum::{response::IntoResponse, Extension}; +use axum_extra::extract::Host; use rkyv::string::ArchivedString; use crate::{ -- rgit 0.1.4