Repository: jdrouet/catapulte (language: rust)

Issue:
build(deps): Bump handlebars from 3.5.5 to 4.0.1
Bumps [handlebars](https://github.com/sunng87/handlebars-rust) from 3.5.5 to 4.0.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/sunng87/handlebars-rust/releases">handlebars's releases</a>.</em></p>
<blockquote>
<h2>v4.0.0</h2>
<h2>4.0 Highlights</h2>
<h3>Development mode</h3>
<p>4.0 brings in <code>dev_mode</code> to Handlebars. By turning on <code>dev_mode</code>, templates loaded from files or directories are auto-reloaded
each time. This makes development workflow more fluent.</p>
<h3>Performance improvement</h3>
<p>4.0 provides up to <strong>20%</strong> performance boost compared to 3.x.</p>
<h3>Bugfixes</h3>
<p>Several corner cases were fixed in this release. Some has already been backported on to 3.x branch.</p>
<h2>Detailed Changelog</h2>
<ul>
<li>[Added] <code>dev_mode</code> for registry: templates and scripts loaded from file are always
reloaded when dev mode enabled <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Added] Registry is now <code>Clone</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Added] New built-in helper <code>len</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/421">#421</a></li>
<li>[Changed] Updated <code>rhai</code> to 0.19 and then 0.20 <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/391">#391</a></li>
<li>[Changed] <code>#each</code> helper now renders else block for non-iterable data <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/380">#380</a></li>
<li>[Changed] <code>TemplateError</code> and <code>ScriptError</code> is now a cause of <code>RenderError</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Changed] Empty lines around block helpers are now stripped <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/404">#404</a></li>
<li>[Changed] <strong>Breaking</strong> <code>RenderContext::get_partial</code> now returns <code>Option&lt;&amp;Template&gt;</code></li>
<li>[Changed] <strong>Breaking</strong> Capitalize names like <code>HtmlExpression</code> and <code>IoError</code> based on clippy recommendations <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/424">#424</a></li>
<li>[Changed] <strong>Breaking</strong> Improved return type of <code>call_inner</code> from <code>HelperDef</code> to avoid misleading <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/437">#437</a></li>
<li>[Fixed] reference starts with <code>null</code>, <code>true</code> and <code>false</code> were parsed incorrectly <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/382">#382</a></li>
<li>[Fixed] dir source path separator bug on windows <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/389">#389</a> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/405">#405</a></li>
<li>[Fixed] stack overflow with nested <code>@partial-block</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/401">#401</a></li>
<li>[Fixed] value access issue when upper block has a base value <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/419">#419</a></li>
<li>[Fixed] escape rules for Json string literal <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/423">#423</a></li>
<li>[Fixed] <strong>Breaking</strong> zero-arity subexpressions support <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/433">#433</a> Zero-arity subexpression no longer resolved as variable. The behaviour is now aligned with handlebarsjs.</li>
<li>[Removed] <strong>Breaking</strong> option to disable source map is removed <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Removed] <strong>Breaking</strong> <code>TemplateFileError</code> and <code>TemplateRenderError</code> are removed and merged into
<code>TemplateError</code> and <code>RenderError</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/sunng87/handlebars-rust/blob/master/CHANGELOG.md">handlebars's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/sunng87/handlebars-rust/compare/4.0.0...4.0.1">4.0.1</a> - 2021-06-15</h2>
<ul>
<li>[Fixed] Each block render error with empty array or object <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/445">#445</a></li>
</ul>
<h2><a href="https://github.com/sunng87/handlebars-rust/compare/3.4.0...4.0.0">4.0.0</a> - 2021-05-25</h2>
<ul>
<li>[Added] <code>dev_mode</code> for registry: templates and scripts loaded from file are always
reloaded when dev mode enabled <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Added] Registry is now <code>Clone</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Added] New built-in helper <code>len</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/421">#421</a></li>
<li>[Changed] Updated <code>rhai</code> to 0.19 and then 0.20 <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/391">#391</a></li>
<li>[Changed] <code>#each</code> helper now renders else block for non-iterable data <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/380">#380</a></li>
<li>[Changed] <code>TemplateError</code> and <code>ScriptError</code> is now a cause of <code>RenderError</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Changed] Empty lines around block helpers are now stripped <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/404">#404</a></li>
<li>[Changed] <strong>Breaking</strong> <code>RenderContext::get_partial</code> now returns <code>Option&lt;&amp;Template&gt;</code></li>
<li>[Changed] <strong>Breaking</strong> Capitalize names like <code>HtmlExpression</code> and <code>IoError</code> based on clippy recommendations <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/424">#424</a></li>
<li>[Changed] <strong>Breaking</strong> Improved return type of <code>call_inner</code> from <code>HelperDef</code> to avoid misleading <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/437">#437</a></li>
<li>[Fixed] reference starts with <code>null</code>, <code>true</code> and <code>false</code> were parsed incorrectly <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/382">#382</a></li>
<li>[Fixed] dir source path separator bug on windows <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/389">#389</a> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/405">#405</a></li>
<li>[Fixed] stack overflow with nested <code>@partial-block</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/401">#401</a></li>
<li>[Fixed] value access issue when upper block has a base value <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/419">#419</a></li>
<li>[Fixed] escape rules for Json string literal <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/423">#423</a></li>
<li>[Fixed] <strong>Breaking</strong> zero-arity subexpressions support <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/433">#433</a>
Zero-arity subexpression no longer resolved as variable. The behaviour is now aligned with handlebarsjs.</li>
<li>[Removed] <strong>Breaking</strong> option to disable source map is removed <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
<li>[Removed] <strong>Breaking</strong> <code>TemplateFileError</code> and <code>TemplateRenderError</code> are removed and merged into
<code>TemplateError</code> and <code>RenderError</code> <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/395">#395</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/1c320caa344ee7119e056933f2518330cfcc7bf3"><code>1c320ca</code></a> (cargo-release) version 4.0.1</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/570016f5f5cf11651832db9d29252a8a3a1f6b55"><code>570016f</code></a> (chore) update changelog</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/9eabe1f9069f55e769ebb07e5d696c7e595c673b"><code>9eabe1f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/445">#445</a> from matthiasbeyer/test-empty-each</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/21e5cf3447fd7b9e9b48d8f3c2783d546815d18d"><code>21e5cf3</code></a> Fix: If there is no &quot;else&quot; block, render the empty array/object</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/2317e0ce040e24f05bfafdafc6049a0143f69142"><code>2317e0c</code></a> Add test for calling each on empty vec</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/4962d7e8d4f18cd15bf187b08172fbb9b3babf74"><code>4962d7e</code></a> (chore) setup github ci</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/a1c2de3a05ee3e76a42ab96aa4da3350c57932f7"><code>a1c2de3</code></a> (doc) update changelog to reflect breaking changes in <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/441">#441</a></li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/23d3012646ac9dfcdc54887c2579fa0edb4949ae"><code>23d3012</code></a> (fix) example of partials</li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/71b3ed94b8ef3267e625135f274a8b82291d9401"><code>71b3ed9</code></a> (doc) add changelog for <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/404">#404</a></li>
<li><a href="https://github.com/sunng87/handlebars-rust/commit/f9d45cdaf735b7c1fde6b6b5b04795e61214ab9e"><code>f9d45cd</code></a> (doc) add len to our doc <a href="https://github-redirect.dependabot.com/sunng87/handlebars-rust/issues/439">#439</a></li>
<li>Additional commits viewable in <a href="https://github.com/sunng87/handlebars-rust/compare/v3.5.5...v4.0.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=cargo&previous-version=3.5.5&new-version=4.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Discussion / hints:

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 8232904c..4765055b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -891,9 +891,9 @@ dependencies = [
 
 [[package]]
 name = "handlebars"
-version = "3.5.5"
+version = "4.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3"
+checksum = "2060119114dd8a8bc87facce6384751af8280a7adc8e203c023c95cbb11f5663"
 dependencies = [
  "log",
  "pest",
diff --git a/Cargo.toml b/Cargo.toml
index b50886d6..5ad18d9e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -19,7 +19,7 @@ actix-rt = "2.2.0"
 async-trait = "0.1.50"
 env_logger = "0.8.4"
 futures = "0.3.15"
-handlebars = "3.5.5"
+handlebars = "4.0.1"
 jsonwebtoken = "7.2.0"
 lazy_static = "1.4.0"
 lettre = { default-features = false, features = ["builder", "r2d2", "rustls-tls", "smtp-transport", "tokio1-rustls-tls"], version = "0.10.0-rc.3" }
diff --git a/src/service/template/template.rs b/src/service/template/template.rs
index a84a64a7..d377e0f0 100644
--- a/src/service/template/template.rs
+++ b/src/service/template/template.rs
@@ -1,6 +1,6 @@
 use crate::error::ServerError;
 use crate::service::multipart::MultipartFile;
-use handlebars::{Handlebars, TemplateRenderError as HandlebarTemplateRenderError};
+use handlebars::{Handlebars, RenderError as HandlebarTemplateRenderError};
 use lettre::message::{Attachment, Body, Mailbox, Message, MessageBuilder, MultiPart, SinglePart};
 use mrml::mjml::MJML;
 use mrml::prelude::parse::Error as ParserError;


Test patch: