From c9a223fd4a8f1fd8c0e76325e9f10d7d63cd537b Mon Sep 17 00:00:00 2001 From: perryrh0dan Date: Sat, 13 Feb 2021 16:53:35 +0100 Subject: [PATCH] fix(renderer): pascalcase transformation pipeline --- .gitignore | 1 + Cargo.lock | 2 +- Cargo.toml | 2 +- changelog.md | 6 ++++++ flame.svg | 0 src/renderer/helpers.rs | 2 +- src/renderer/mod.rs | 2 +- 7 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 flame.svg diff --git a/.gitignore b/.gitignore index 393565a..1d3c8ac 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ perf.data perf.data.old flamegraph.svg +flame.svg diff --git a/Cargo.lock b/Cargo.lock index 044cd65..0009c50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1671,7 +1671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tmpo" -version = "2.4.0" +version = "2.4.1" dependencies = [ "assert_cli 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "assert_cmd 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 2317781..61e7f64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tmpo" description = "Command line utility to create new workspaces based on predefined templates" -version = "2.4.0" +version = "2.4.1" authors = ["Thomas Pöhlmann "] edition = "2018" license = "MIT" diff --git a/changelog.md b/changelog.md index 3bead53..aaadf8f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # What's new in Tmpo +## 2.4.1 + +### Fix + +- Fix `PascalCase` transformation method. + ## 2.4.0 ### Feature diff --git a/flame.svg b/flame.svg new file mode 100644 index 0000000..e69de29 diff --git a/src/renderer/helpers.rs b/src/renderer/helpers.rs index d6629ed..76637fa 100644 --- a/src/renderer/helpers.rs +++ b/src/renderer/helpers.rs @@ -68,7 +68,7 @@ pub fn pascalcase_helper( .param(0) .ok_or(RenderError::new("Param 0 is required for format helper."))?; - let rendered = param.value().render().to_string().to_case(Case::Camel); + let rendered = param.value().render().to_string().to_case(Case::Pascal); out.write(rendered.as_ref())?; Ok(()) } diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index ddbe51b..13fbe26 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -116,7 +116,7 @@ mod tests { assert_eq!( result, - "thomasPöhlmann,THOMAS_PÖHLMANN,thomas-pöhlmann,thomaspöhlmann,thomasPöhlmann,thomas_pöhlmann,THOMASPÖHLMANN" + "thomasPöhlmann,THOMAS_PÖHLMANN,thomas-pöhlmann,thomaspöhlmann,ThomasPöhlmann,thomas_pöhlmann,THOMASPÖHLMANN" ); Ok(())