From a4c1b779f22329ee02c2c4c24cdc6cc3c850447c Mon Sep 17 00:00:00 2001 From: Slatian Date: Fri, 10 Oct 2025 13:17:04 +0200 Subject: [PATCH] Update lib-humus to 0.4 --- Cargo.lock | 77 +++++++++++++++++++++++++++++++++++++++++++++++------ Cargo.toml | 3 ++- src/main.rs | 4 +-- 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0b9aeb..973d7f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -545,6 +545,7 @@ dependencies = [ "http", "idna", "lib-humus", + "lib-humus-configuration", "log", "maxminddb", "mime", @@ -553,7 +554,7 @@ dependencies = [ "serde", "tera", "tokio", - "toml", + "toml 0.8.23", "tower", "tower-http", ] @@ -1274,17 +1275,29 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lib-humus" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262ee437b006be6905b56611e1a0f80cfa5c6e6a8cac73248fc4bd60af09c3e4" +checksum = "a46829a525b0b40f5100b62216dc6851ea3181a7522274ff342b3c205d150c1c" dependencies = [ "axum", "axum-extra", + "lib-humus-configuration", "log", "mime", "serde", "tera", - "toml", + "toml 0.9.8", +] + +[[package]] +name = "lib-humus-configuration" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad6270e962ff2af18516dc70519a18af0c772d9f3956eafd3618629560e55312" +dependencies = [ + "serde", + "serde_json", + "toml 0.9.8", ] [[package]] @@ -2077,6 +2090,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" +dependencies = [ + "serde_core", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2413,11 +2435,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", - "serde_spanned", - "toml_datetime", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", "toml_edit", ] +[[package]] +name = "toml" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned 1.0.3", + "toml_datetime 0.7.3", + "toml_parser", + "toml_writer", + "winnow", +] + [[package]] name = "toml_datetime" version = "0.6.11" @@ -2427,6 +2464,15 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +dependencies = [ + "serde_core", +] + [[package]] name = "toml_edit" version = "0.22.27" @@ -2435,18 +2481,33 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap", "serde", - "serde_spanned", - "toml_datetime", + "serde_spanned 0.6.9", + "toml_datetime 0.6.11", "toml_write", "winnow", ] +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ + "winnow", +] + [[package]] name = "toml_write" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tower" version = "0.5.2" diff --git a/Cargo.toml b/Cargo.toml index ef73397..d4617cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,8 @@ authors = ["Slatian "] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -lib-humus = { version="0.3", features=["axum-view+cookie"] } +lib-humus = { version="0.4", features=["axum-view+cookie"] } +lib-humus-configuration = { version = "0.1.0", featres=["toml"] } axum-client-ip = "0.7" axum-extra = { version = "0.10", features = ["cookie", "typed-header"] } diff --git a/src/main.rs b/src/main.rs index fe1cabc..cc1fa20 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,7 +45,7 @@ use std::sync::Arc; use std::sync::LazyLock; use lib_humus::TemplateEngineLoader; -use lib_humus::read_toml_from_file; +use lib_humus_configuration::read_from_toml_file; use lib_humus::HumusEngine; mod config; @@ -182,7 +182,7 @@ async fn main() { // Read configuration file let config: config::EchoIpServiceConfig = match cli_args.config { Some(config_path) => { - match read_toml_from_file::(&config_path) { + match read_from_toml_file::(&config_path) { Ok(c) => c, Err(e) => { error!("Could not read confuration file!");