From 6a526a8a172fd05f5297014fae74c4f817e3c28b Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Tue, 3 Dec 2024 22:42:20 +0800 Subject: [PATCH] feat: handlebars 6 (#191) --- Cargo.lock | 25 ++++++++++++++++++++----- Cargo.toml | 4 ++-- src/actions.rs | 2 +- src/filesystem.rs | 3 +-- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 709cd93..5da20a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -947,11 +947,12 @@ dependencies = [ [[package]] name = "handlebars" -version = "5.1.2" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" +checksum = "fd4ccde012831f9a071a637b0d4e31df31c0f6c525784b35ae76a9ac6bc1e315" dependencies = [ "log", + "num-order", "pest", "pest_derive", "rhai", @@ -962,15 +963,14 @@ dependencies = [ [[package]] name = "handlebars_misc_helpers" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d23af2de02b372be35cf2c6a99a8481064dd9e5fc39c625a82b45da9ea22838" +checksum = "4a6b7773acad4d2ef705172b8b9a50f9e9d94dba9d6f6f0309a73453509e90da" dependencies = [ "cruet", "enquote", "handlebars", "jmespath", - "lazy_static", "log", "serde", "serde_json", @@ -1370,6 +1370,21 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-modular" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17bb261bf36fa7d83f4c294f834e91256769097b3cb505d44831e0a179ac647f" + +[[package]] +name = "num-order" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537b596b97c40fcf8056d153049eb22f481c17ebce72a513ec9286e4986d1bb6" +dependencies = [ + "num-modular", +] + [[package]] name = "num-traits" version = "0.2.19" diff --git a/Cargo.toml b/Cargo.toml index 8fd1ef8..74bbfae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ clap = { version = "4.0.26", features = ["derive"] } clap_complete = "4.0.5" crossterm = "0.25.0" diff = "0.1.*" -handlebars = "5.*" +handlebars = "6.*" hostname = "0.3.*" log = "0.4.*" maplit = "1.*" @@ -37,7 +37,7 @@ scripting = ["handlebars/script_helper"] watch = ["watchexec", "watchexec-events", "watchexec-filterer-tagged"] [dependencies.handlebars_misc_helpers] -version = "0.15.*" +version = "0.17.*" default-features = false features = ["string", "json"] diff --git a/src/actions.rs b/src/actions.rs index 002b698..e1b665a 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -55,7 +55,7 @@ impl<'a> RealActionRunner<'a> { } } -impl<'a> ActionRunner for RealActionRunner<'a> { +impl ActionRunner for RealActionRunner<'_> { fn delete_symlink(&mut self, source: &Path, target: &Path) -> Result { delete_symlink(source, target, self.fs, self.force) } diff --git a/src/filesystem.rs b/src/filesystem.rs index 3ade72e..f7d66a8 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -793,8 +793,7 @@ fn compare_template(target_state: FileState, cache_state: FileState) -> Template } } -/// === Utility functions === - +// === Utility functions === pub fn real_path(path: &Path) -> Result { let path = std::fs::canonicalize(path)?; Ok(platform_dunce(&path))