Explorar o código

use handlebars::no_escape instead of closures (#6899)

chip %!s(int64=2) %!d(string=hai) anos
pai
achega
24490bca19

+ 1 - 1
tooling/bundler/src/bundle/linux/appimage.rs

@@ -81,7 +81,7 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
 
   // initialize shell script template.
   let mut handlebars = Handlebars::new();
-  handlebars.register_escape_fn(|s| s.into());
+  handlebars.register_escape_fn(handlebars::no_escape);
   handlebars
     .register_template_string("appimage", include_str!("templates/appimage"))
     .expect("Failed to register template for handlebars");

+ 3 - 3
tooling/bundler/src/bundle/windows/msi/wix.rs

@@ -614,7 +614,7 @@ pub fn build_wix_app_installer(
 
   let mut fragment_paths = Vec::new();
   let mut handlebars = Handlebars::new();
-  handlebars.register_escape_fn(|s| s.into());
+  handlebars.register_escape_fn(handlebars::no_escape);
   let mut has_custom_template = false;
   let mut enable_elevated_update_task = false;
 
@@ -693,7 +693,7 @@ pub fn build_wix_app_installer(
 
     // Create the Powershell script to install the task
     let mut skip_uac_task_installer = Handlebars::new();
-    skip_uac_task_installer.register_escape_fn(|s| s.into());
+    skip_uac_task_installer.register_escape_fn(handlebars::no_escape);
     let xml = include_str!("../templates/install-task.ps1");
     skip_uac_task_installer
       .register_template_string("install-task.ps1", xml)
@@ -705,7 +705,7 @@ pub fn build_wix_app_installer(
 
     // Create the Powershell script to uninstall the task
     let mut skip_uac_task_uninstaller = Handlebars::new();
-    skip_uac_task_uninstaller.register_escape_fn(|s| s.into());
+    skip_uac_task_uninstaller.register_escape_fn(handlebars::no_escape);
     let xml = include_str!("../templates/uninstall-task.ps1");
     skip_uac_task_uninstaller
       .register_template_string("uninstall-task.ps1", xml)

+ 1 - 1
tooling/cli/src/init.rs

@@ -184,7 +184,7 @@ pub fn command(mut options: Options) -> Result<()> {
 
     let _ = remove_dir_all(&template_target_path);
     let mut handlebars = Handlebars::new();
-    handlebars.register_escape_fn(|s| s.into());
+    handlebars.register_escape_fn(handlebars::no_escape);
 
     let mut data = BTreeMap::new();
     data.insert("tauri_dep", to_json(tauri_dep));

+ 1 - 1
tooling/cli/src/plugin/init.rs

@@ -90,7 +90,7 @@ pub fn command(mut options: Options) -> Result<()> {
 
     let _ = remove_dir_all(&template_target_path);
     let mut handlebars = Handlebars::new();
-    handlebars.register_escape_fn(|s| s.into());
+    handlebars.register_escape_fn(handlebars::no_escape);
 
     let mut data = BTreeMap::new();
     data.insert("plugin_name_original", to_json(&options.plugin_name));