From c8ef181b7dbb44220916131c92220f95d0bc2d43 Mon Sep 17 00:00:00 2001 From: Guilherme Souza Date: Wed, 26 Jun 2024 10:07:12 +0200 Subject: [PATCH] Update to axum 0.7 and handlebars 5 --- feattle-ui/Cargo.toml | 6 +++--- feattle/Cargo.toml | 4 ++-- feattle/examples/full.rs | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/feattle-ui/Cargo.toml b/feattle-ui/Cargo.toml index 5233a37..b50936f 100644 --- a/feattle-ui/Cargo.toml +++ b/feattle-ui/Cargo.toml @@ -13,11 +13,11 @@ categories = ["config", "data-structures", "development-tools", "web-programming # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -axum = { version = "0.6.16", optional = true, default-features = false, features = ["form", "json"] } +axum = { version = "0.7.5", optional = true, default-features = false, features = ["form", "json"] } chrono = { version = "0.4.15", features = ["serde"] } feattle-core = { path = "../feattle-core", version = "1.0.0" } futures = "0.3.5" -handlebars = "4.1.2" +handlebars = "5.1.2" log = "0.4.11" serde = { version = "1.0.115", features = ["derive"] } serde_json = "1.0.57" @@ -25,7 +25,7 @@ thiserror = "1.0.20" warp = { version = "0.3.0", optional = true } [dev-dependencies] -axum = { version = "0.6.16", features = ["tokio"] } +axum = { version = "0.7.5", features = ["tokio"] } tokio = { version = "1.4.0", features = ["macros", "rt"] } [package.metadata.docs.rs] diff --git a/feattle/Cargo.toml b/feattle/Cargo.toml index 587a773..2095443 100644 --- a/feattle/Cargo.toml +++ b/feattle/Cargo.toml @@ -26,10 +26,10 @@ feattle-ui = { path = "../feattle-ui", version = "1.0.0" } [dev-dependencies] aws-config = { version = "1.5.3", features = ["behavior-version-latest"] } -axum = { version = "0.6.16", features = ["tokio"] } +axum = { version = "0.7.5", features = ["tokio"] } chrono = { version = "0.4.15", features = ["serde"] } dotenv = "0.15.0" -env_logger = "0.10.0" +env_logger = "0.11.3" rusoto_core = { version = "0.48.0" } rusoto_s3 = { version = "0.48.0" } serde = { version = "1.0.115", features = ["derive"] } diff --git a/feattle/examples/full.rs b/feattle/examples/full.rs index 468aa13..07ca120 100644 --- a/feattle/examples/full.rs +++ b/feattle/examples/full.rs @@ -1,9 +1,10 @@ -use axum::Server; use feattle::*; use std::collections::BTreeMap; use std::env; use std::error::Error; +use std::future::IntoFuture; use std::sync::Arc; +use tokio::net::TcpListener; use tokio::time::Duration; use uuid::Uuid; @@ -92,7 +93,8 @@ async fn main() -> Result<(), Box> { // Serve the admin panel with `axum` let router = axum_router(panel); - tokio::spawn(Server::bind(&([127, 0, 0, 1], 3031).into()).serve(router.into_make_service())); + let listener = TcpListener::bind(("127.0.0.1", 3031)).await?; + tokio::spawn(axum::serve(listener, router.into_make_service()).into_future()); println!("Admin UI available in http://127.0.0.1:3030");