From c2d87059944ee82f8a6627bfd968c5ad3a8c5fc3 Mon Sep 17 00:00:00 2001 From: Philip Cristiano Date: Thu, 4 Jan 2024 09:55:19 -0500 Subject: [PATCH] chore: axum 0.7 / maud >0.25 compat Maud has compatability for 0.7 with https://github.com/lambda-fairy/maud/pull/401 but it isn't released in a 0.26 version yet. Use a source release with specific rev until a 0.26 is cut --- Cargo.lock | 13 +++++-------- Cargo.toml | 6 +++++- src/main.rs | 8 +++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99462ed..a3c8d24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1291,11 +1291,10 @@ checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" [[package]] name = "maud" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0bab19cef8a7fe1c18a43e881793bfc9d4ea984befec3ae5bd0415abf3ecf00" +source = "git+https://github.com/lambda-fairy/maud.git?rev=320add8#320add87a12d8e5be115de9e0fe3f4b331512a4a" dependencies = [ - "axum-core 0.3.4", - "http 0.2.9", + "axum-core 0.4.2", + "http 1.0.0", "itoa", "maud_macros", ] @@ -1303,13 +1302,12 @@ dependencies = [ [[package]] name = "maud_macros" version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be95d66c3024ffce639216058e5bae17a83ecaf266ffc6e4d060ad447c9eed2" +source = "git+https://github.com/lambda-fairy/maud.git?rev=320add8#320add87a12d8e5be115de9e0fe3f4b331512a4a" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.28", ] [[package]] @@ -1763,7 +1761,6 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", "version_check", ] diff --git a/Cargo.toml b/Cargo.toml index c7cdf14..5a05ca6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,11 @@ license = "Apache-2.0" anyhow = "1.0.78" axum = "0.7.3" clap = { version = "4.4.12", features = ["derive", "env"]} -maud = { version = "0.25.0", features = ["axum"] } + +# Waiting on a release of maud to have axum 0.7 compat +# maud = { version = "0.25.0", features = ["axum"] } +maud = { git = "https://github.com/lambda-fairy/maud.git", rev="320add8", features = ["axum"] } + once_cell = "1.19.0" openidconnect = "3.4.0" serde = { version = "1.0", features = ["derive"] } diff --git a/src/main.rs b/src/main.rs index f2b16a2..53b28c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -72,11 +72,9 @@ async fn main() { ); let addr: SocketAddr = args.bind_addr.parse().expect("Expected bind addr"); - tracing::info!("listening on http://{}", addr); - axum::Server::bind(&addr) - .serve(app.into_make_service()) - .await - .unwrap(); + tracing::info!("listening on {}", addr); + let listener = tokio::net::TcpListener::bind(&addr).await.unwrap(); + axum::serve(listener, app).await.unwrap(); } // basic handler that responds with a static string