瀏覽代碼

chore: fix clippy warnings

Lucas Nogueira 2 年之前
父節點
當前提交
d21c4a0a89
共有 52 個文件被更改,包括 145 次插入166 次删除
  1. 2 2
      core/config-schema/build.rs
  2. 2 2
      core/tauri-build/src/codegen/context.rs
  3. 9 9
      core/tauri-build/src/lib.rs
  4. 2 5
      core/tauri-codegen/src/context.rs
  5. 2 2
      core/tauri-codegen/src/embedded_assets.rs
  6. 1 4
      core/tauri-macros/src/mobile.rs
  7. 1 1
      core/tauri-runtime-wry/build.rs
  8. 1 1
      core/tauri-runtime/build.rs
  9. 9 10
      core/tauri-utils/src/config.rs
  10. 5 5
      core/tauri-utils/src/html.rs
  11. 1 1
      core/tauri-utils/src/mime_type.rs
  12. 4 4
      core/tauri-utils/src/platform.rs
  13. 5 5
      core/tauri/build.rs
  14. 1 1
      core/tauri/src/api/dir.rs
  15. 2 2
      core/tauri/src/api/file/extract.rs
  16. 3 4
      core/tauri/src/api/http.rs
  17. 4 4
      core/tauri/src/api/ipc.rs
  18. 1 1
      core/tauri/src/api/shell.rs
  19. 2 3
      core/tauri/src/app.rs
  20. 1 2
      core/tauri/src/endpoints.rs
  21. 1 1
      core/tauri/src/endpoints/event.rs
  22. 2 2
      core/tauri/src/endpoints/shell.rs
  23. 5 8
      core/tauri/src/event.rs
  24. 1 1
      core/tauri/src/hooks.rs
  25. 9 14
      core/tauri/src/lib.rs
  26. 6 7
      core/tauri/src/manager.rs
  27. 2 2
      core/tauri/src/pattern.rs
  28. 2 4
      core/tauri/src/plugin.rs
  29. 1 1
      core/tauri/src/scope/http.rs
  30. 13 15
      core/tauri/src/updater/core.rs
  31. 2 2
      core/tauri/src/updater/mod.rs
  32. 2 2
      core/tests/app-updater/src/main.rs
  33. 3 4
      core/tests/app-updater/tests/update.rs
  34. 1 1
      core/tests/restart/src/main.rs
  35. 1 1
      core/tests/restart/tests/restart.rs
  36. 1 1
      examples/commands/commands.rs
  37. 13 13
      examples/commands/main.rs
  38. 1 1
      examples/multiwindow/main.rs
  39. 1 1
      examples/parent-window/main.rs
  40. 1 1
      examples/streaming/main.rs
  41. 1 1
      tooling/bundler/src/bundle/linux/debian.rs
  42. 4 1
      tooling/bundler/src/bundle/path_utils.rs
  43. 2 2
      tooling/bundler/src/bundle/settings.rs
  44. 1 1
      tooling/cli/src/build.rs
  45. 1 1
      tooling/cli/src/dev.rs
  46. 4 4
      tooling/cli/src/helpers/updater_signature.rs
  47. 1 1
      tooling/cli/src/info.rs
  48. 1 1
      tooling/cli/src/interface/rust.rs
  49. 1 1
      tooling/cli/src/interface/rust/desktop.rs
  50. 1 1
      tooling/cli/src/mobile/android/build.rs
  51. 1 1
      tooling/cli/src/mobile/android/dev.rs
  52. 1 1
      tooling/cli/src/plugin/init.rs

+ 2 - 2
core/config-schema/build.rs

@@ -17,8 +17,8 @@ pub fn main() -> Result<(), Box<dyn Error>> {
     crate_dir.join("schema.json"),
     crate_dir.join("../../tooling/cli/schema.json"),
   ] {
-    let mut schema_file = BufWriter::new(File::create(&file)?);
-    write!(schema_file, "{}", schema_str)?;
+    let mut schema_file = BufWriter::new(File::create(file)?);
+    write!(schema_file, "{schema_str}")?;
   }
 
   Ok(())

+ 2 - 2
core/tauri-build/src/codegen/context.rs

@@ -86,7 +86,7 @@ impl CodegenContext {
   pub fn build(self) -> PathBuf {
     match self.try_build() {
       Ok(out) => out,
-      Err(error) => panic!("Error found during Codegen::build: {}", error),
+      Err(error) => panic!("Error found during Codegen::build: {error}"),
     }
   }
 
@@ -161,7 +161,7 @@ impl CodegenContext {
       )
     })?;
 
-    writeln!(file, "{}", code).with_context(|| {
+    writeln!(file, "{code}").with_context(|| {
       format!(
         "Unable to write tokenstream to out file during tauri-build {}",
         out.display()

+ 9 - 9
core/tauri-build/src/lib.rs

@@ -35,8 +35,8 @@ fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
   Ok(())
 }
 
-fn copy_binaries<'a>(
-  binaries: ResourcePaths<'a>,
+fn copy_binaries(
+  binaries: ResourcePaths,
   target_triple: &str,
   path: &Path,
   package_name: Option<&String>,
@@ -48,7 +48,7 @@ fn copy_binaries<'a>(
       .file_name()
       .expect("failed to extract external binary filename")
       .to_string_lossy()
-      .replace(&format!("-{}", target_triple), "");
+      .replace(&format!("-{target_triple}"), "");
 
     if package_name.map_or(false, |n| n == &file_name) {
       return Err(anyhow::anyhow!(
@@ -72,7 +72,7 @@ fn copy_resources(resources: ResourcePaths<'_>, path: &Path) -> Result<()> {
     let src = src?;
     println!("cargo:rerun-if-changed={}", src.display());
     let dest = path.join(resource_relpath(&src));
-    copy_file(&src, &dest)?;
+    copy_file(&src, dest)?;
   }
   Ok(())
 }
@@ -90,7 +90,7 @@ fn has_feature(feature: &str) -> bool {
 // `alias` must be a snake case string.
 fn cfg_alias(alias: &str, has_feature: bool) {
   if has_feature {
-    println!("cargo:rustc-cfg={}", alias);
+    println!("cargo:rustc-cfg={alias}");
   }
 }
 
@@ -179,8 +179,8 @@ impl Attributes {
 /// This is typically desirable when running inside a build script; see [`try_build`] for no panics.
 pub fn build() {
   if let Err(error) = try_build(Attributes::default()) {
-    let error = format!("{:#}", error);
-    println!("{}", error);
+    let error = format!("{error:#}");
+    println!("{error}");
     if error.starts_with("unknown field") {
       print!("found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. ");
       println!(
@@ -229,7 +229,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
     }
   }
   domain.pop();
-  println!("cargo:rustc-env=TAURI_ANDROID_DOMAIN={}", domain);
+  println!("cargo:rustc-env=TAURI_ANDROID_DOMAIN={domain}");
 
   cfg_alias("dev", !has_feature("custom-protocol"));
 
@@ -288,7 +288,7 @@ pub fn try_build(attributes: Attributes) -> Result<()> {
 
   let target_triple = std::env::var("TARGET").unwrap();
 
-  println!("cargo:rustc-env=TAURI_TARGET_TRIPLE={}", target_triple);
+  println!("cargo:rustc-env=TAURI_TARGET_TRIPLE={target_triple}");
 
   let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
   // TODO: far from ideal, but there's no other way to get the target dir, see <https://github.com/rust-lang/cargo/issues/5457>

+ 2 - 5
core/tauri-codegen/src/context.rs

@@ -142,7 +142,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
       } else if target.contains("apple-ios") {
         Target::Ios
       } else {
-        panic!("unknown codegen target {}", target);
+        panic!("unknown codegen target {target}");
       }
     } else if cfg!(target_os = "linux") {
       Target::Linux
@@ -371,10 +371,7 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE
     PatternKind::Isolation { dir } => {
       let dir = config_parent.join(dir);
       if !dir.exists() {
-        panic!(
-          "The isolation application path is set to `{:?}` but it does not exist",
-          dir
-        )
+        panic!("The isolation application path is set to `{dir:?}` but it does not exist")
       }
 
       let mut sets_isolation_hook = false;

+ 2 - 2
core/tauri-codegen/src/embedded_assets.rs

@@ -343,14 +343,14 @@ impl EmbeddedAssets {
 
       let mut hex = String::with_capacity(2 * bytes.len());
       for b in bytes {
-        write!(hex, "{:02x}", b).map_err(EmbeddedAssetsError::Hex)?;
+        write!(hex, "{b:02x}").map_err(EmbeddedAssetsError::Hex)?;
       }
       hex
     };
 
     // use the content hash to determine filename, keep extensions that exist
     let out_path = if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
-      out_dir.join(format!("{}.{}", hash, ext))
+      out_dir.join(format!("{hash}.{ext}"))
     } else {
       out_dir.join(hash)
     };

+ 1 - 4
core/tauri-macros/src/mobile.rs

@@ -19,10 +19,7 @@ fn get_env_var<R: FnOnce(String) -> String>(
       error.replace(
         syn::Error::new(
           function.span(),
-          format!(
-            "`{}` env var not set, do you have a build script with tauri-build?",
-            name,
-          ),
+          format!("`{name}` env var not set, do you have a build script with tauri-build?",),
         )
         .into_compile_error(),
       );

+ 1 - 1
core/tauri-runtime-wry/build.rs

@@ -6,7 +6,7 @@
 // `alias` must be a snake case string.
 fn alias(alias: &str, has_feature: bool) {
   if has_feature {
-    println!("cargo:rustc-cfg={}", alias);
+    println!("cargo:rustc-cfg={alias}");
   }
 }
 

+ 1 - 1
core/tauri-runtime/build.rs

@@ -6,7 +6,7 @@
 // `alias` must be a snake case string.
 fn alias(alias: &str, has_feature: bool) {
   if has_feature {
-    println!("cargo:rustc-cfg={}", alias);
+    println!("cargo:rustc-cfg={alias}");
   }
 }
 

+ 9 - 10
core/tauri-utils/src/config.rs

@@ -55,7 +55,7 @@ pub enum WindowUrl {
 impl fmt::Display for WindowUrl {
   fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
     match self {
-      Self::External(url) => write!(f, "{}", url),
+      Self::External(url) => write!(f, "{url}"),
       Self::App(path) => write!(f, "{}", path.display()),
     }
   }
@@ -125,7 +125,7 @@ impl<'de> Deserialize<'de> for BundleType {
       "app" => Ok(Self::App),
       "dmg" => Ok(Self::Dmg),
       "updater" => Ok(Self::Updater),
-      _ => Err(DeError::custom(format!("unknown bundle target '{}'", s))),
+      _ => Err(DeError::custom(format!("unknown bundle target '{s}'"))),
     }
   }
 }
@@ -223,7 +223,7 @@ impl<'de> Deserialize<'de> for BundleTarget {
 
     match BundleTargetInner::deserialize(deserializer)? {
       BundleTargetInner::All(s) if s.to_lowercase() == "all" => Ok(Self::All),
-      BundleTargetInner::All(t) => Err(DeError::custom(format!("invalid bundle type {}", t))),
+      BundleTargetInner::All(t) => Err(DeError::custom(format!("invalid bundle type {t}"))),
       BundleTargetInner::List(l) => Ok(Self::List(l)),
       BundleTargetInner::One(t) => Ok(Self::One(t)),
     }
@@ -988,7 +988,7 @@ impl CspDirectiveSources {
   /// Whether the given source is configured on this directive or not.
   pub fn contains(&self, source: &str) -> bool {
     match self {
-      Self::Inline(s) => s.contains(&format!("{} ", source)) || s.contains(&format!(" {}", source)),
+      Self::Inline(s) => s.contains(&format!("{source} ")) || s.contains(&format!(" {source}")),
       Self::List(l) => l.contains(&source.into()),
     }
   }
@@ -1054,7 +1054,7 @@ impl From<Csp> for HashMap<String, CspDirectiveSources> {
 impl Display for Csp {
   fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
     match self {
-      Self::Policy(s) => write!(f, "{}", s),
+      Self::Policy(s) => write!(f, "{s}"),
       Self::DirectiveMap(m) => {
         let len = m.len();
         let mut i = 0;
@@ -2349,8 +2349,7 @@ impl<'de> Deserialize<'de> for WindowsUpdateInstallMode {
       "quiet" => Ok(Self::Quiet),
       "passive" => Ok(Self::Passive),
       _ => Err(DeError::custom(format!(
-        "unknown update install mode '{}'",
-        s
+        "unknown update install mode '{s}'"
       ))),
     }
   }
@@ -2506,7 +2505,7 @@ pub enum AppUrl {
 impl std::fmt::Display for AppUrl {
   fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
     match self {
-      Self::Url(url) => write!(f, "{}", url),
+      Self::Url(url) => write!(f, "{url}"),
       Self::Files(files) => write!(f, "{}", serde_json::to_string(files).unwrap()),
     }
   }
@@ -2645,9 +2644,9 @@ impl<'d> serde::Deserialize<'d> for PackageVersion {
         let path = PathBuf::from(value);
         if path.exists() {
           let json_str = read_to_string(&path)
-            .map_err(|e| DeError::custom(format!("failed to read version JSON file: {}", e)))?;
+            .map_err(|e| DeError::custom(format!("failed to read version JSON file: {e}")))?;
           let package_json: serde_json::Value = serde_json::from_str(&json_str)
-            .map_err(|e| DeError::custom(format!("failed to read version JSON file: {}", e)))?;
+            .map_err(|e| DeError::custom(format!("failed to read version JSON file: {e}")))?;
           if let Some(obj) = package_json.as_object() {
             let version = obj
               .get("version")

+ 5 - 5
core/tauri-utils/src/html.rs

@@ -37,7 +37,7 @@ fn serialize_node_ref_internal<S: Serializer>(
   traversal_scope: TraversalScope,
 ) -> crate::Result<()> {
   match (traversal_scope, node.data()) {
-    (ref scope, &NodeData::Element(ref element)) => {
+    (ref scope, NodeData::Element(element)) => {
       if *scope == TraversalScope::IncludeNode {
         let attrs = element.attributes.borrow();
 
@@ -82,16 +82,16 @@ fn serialize_node_ref_internal<S: Serializer>(
 
     (TraversalScope::ChildrenOnly(_), _) => Ok(()),
 
-    (TraversalScope::IncludeNode, &NodeData::Doctype(ref doctype)) => {
+    (TraversalScope::IncludeNode, NodeData::Doctype(doctype)) => {
       serializer.write_doctype(&doctype.name).map_err(Into::into)
     }
-    (TraversalScope::IncludeNode, &NodeData::Text(ref text)) => {
+    (TraversalScope::IncludeNode, NodeData::Text(text)) => {
       serializer.write_text(&text.borrow()).map_err(Into::into)
     }
-    (TraversalScope::IncludeNode, &NodeData::Comment(ref text)) => {
+    (TraversalScope::IncludeNode, NodeData::Comment(text)) => {
       serializer.write_comment(&text.borrow()).map_err(Into::into)
     }
-    (TraversalScope::IncludeNode, &NodeData::ProcessingInstruction(ref contents)) => {
+    (TraversalScope::IncludeNode, NodeData::ProcessingInstruction(contents)) => {
       let contents = contents.borrow();
       serializer
         .write_processing_instruction(&contents.0, &contents.1)

+ 1 - 1
core/tauri-utils/src/mime_type.rs

@@ -39,7 +39,7 @@ impl std::fmt::Display for MimeType {
       MimeType::Svg => "image/svg+xml",
       MimeType::Mp4 => "video/mp4",
     };
-    write!(f, "{}", mime)
+    write!(f, "{mime}")
   }
 }
 

+ 4 - 4
core/tauri-utils/src/platform.rs

@@ -133,10 +133,10 @@ pub fn target_triple() -> crate::Result<String> {
       return Err(crate::Error::Environment);
     };
 
-    format!("{}-{}", os, env)
+    format!("{os}-{env}")
   };
 
-  Ok(format!("{}-{}", arch, os))
+  Ok(format!("{arch}-{os}"))
 }
 
 /// Computes the resource directory of the current environment.
@@ -157,8 +157,8 @@ pub fn resource_dir(package_info: &PackageInfo, env: &Env) -> crate::Result<Path
   let exe_dir = exe.parent().expect("failed to get exe directory");
   let curr_dir = exe_dir.display().to_string();
 
-  if curr_dir.ends_with(format!("{S}target{S}debug", S = MAIN_SEPARATOR).as_str())
-    || curr_dir.ends_with(format!("{S}target{S}release", S = MAIN_SEPARATOR).as_str())
+  if curr_dir.ends_with(format!("{MAIN_SEPARATOR}target{MAIN_SEPARATOR}debug").as_str())
+    || curr_dir.ends_with(format!("{MAIN_SEPARATOR}target{MAIN_SEPARATOR}release").as_str())
     || cfg!(target_os = "windows")
   {
     // running from the out dir or windows

+ 5 - 5
core/tauri/build.rs

@@ -31,7 +31,7 @@ fn has_feature(feature: &str) -> bool {
 // `alias` must be a snake case string.
 fn alias(alias: &str, has_feature: bool) {
   if has_feature {
-    println!("cargo:rustc-cfg={}", alias);
+    println!("cargo:rustc-cfg={alias}");
   }
 }
 
@@ -136,8 +136,8 @@ fn main() {
   let checked_features_out_path =
     Path::new(&std::env::var("OUT_DIR").unwrap()).join("checked_features");
   std::fs::write(
-    &checked_features_out_path,
-    &CHECKED_FEATURES.get().unwrap().lock().unwrap().join(","),
+    checked_features_out_path,
+    CHECKED_FEATURES.get().unwrap().lock().unwrap().join(","),
   )
   .expect("failed to write checked_features file");
 }
@@ -152,14 +152,14 @@ fn main() {
 //
 // Note that both `module` and `apis` strings must be written in kebab case.
 fn alias_module(module: &str, apis: &[&str], api_all: bool) {
-  let all_feature_name = format!("{}-all", module);
+  let all_feature_name = format!("{module}-all");
   let all = has_feature(&all_feature_name) || api_all;
   alias(&all_feature_name.to_snake_case(), all);
 
   let mut any = all;
 
   for api in apis {
-    let has = has_feature(&format!("{}-{}", module, api)) || all;
+    let has = has_feature(&format!("{module}-{api}")) || all;
     alias(
       &format!("{}_{}", AsSnakeCase(module), AsSnakeCase(api)),
       has,

+ 1 - 1
core/tauri/src/api/dir.rs

@@ -226,7 +226,7 @@ mod test {
   fn check_test_dir() {
     // create a callback closure that takes in a TempDir type and prints it.
     let callback = |td: &tempfile::TempDir| {
-      println!("{:?}", td);
+      println!("{td:?}");
     };
 
     // execute the with_temp_dir function on the callback

+ 2 - 2
core/tauri/src/api/file/extract.rs

@@ -150,7 +150,7 @@ impl<'a, R: std::fmt::Debug + Read + Seek> std::fmt::Debug for Extract<'a, R> {
 impl<'a, R: Read + Seek> Extract<'a, R> {
   /// Create archive from reader.
   pub fn from_cursor(mut reader: R, archive_format: ArchiveFormat) -> Extract<'a, R> {
-    if reader.seek(io::SeekFrom::Start(0)).is_err() {
+    if reader.rewind().is_err() {
       #[cfg(debug_assertions)]
       eprintln!("Could not seek to start of the file");
     }
@@ -245,7 +245,7 @@ impl<'a, R: Read + Seek> Extract<'a, R> {
             // such as: 爱交易.app/, that does not work as expected.
             // Here we require the file name must be a valid UTF-8.
             let file_name = String::from_utf8(file.name_raw().to_vec())?;
-            let out_path = into_dir.join(&file_name);
+            let out_path = into_dir.join(file_name);
             if file.is_dir() {
               fs::create_dir_all(&out_path)?;
             } else {

+ 3 - 4
core/tauri/src/api/http.rs

@@ -368,7 +368,7 @@ impl TryFrom<FilePart> for Vec<u8> {
   type Error = crate::api::Error;
   fn try_from(file: FilePart) -> crate::api::Result<Self> {
     let bytes = match file {
-      FilePart::Path(path) => std::fs::read(&path)?,
+      FilePart::Path(path) => std::fs::read(path)?,
       FilePart::Contents(bytes) => bytes,
     };
     Ok(bytes)
@@ -441,8 +441,7 @@ impl<'de> Deserialize<'de> for HeaderMap {
         headers.insert(key, value);
       } else {
         return Err(serde::de::Error::custom(format!(
-          "invalid header `{}` `{}`",
-          key, value
+          "invalid header `{key}` `{value}`"
         )));
       }
     }
@@ -662,7 +661,7 @@ impl Response {
     let data = match self.0 {
       ResponseType::Json => self.1.json()?,
       ResponseType::Text => Value::String(self.1.text()?),
-      ResponseType::Binary => serde_json::to_value(&self.1.bytes()?)?,
+      ResponseType::Binary => serde_json::to_value(self.1.bytes()?)?,
     };
 
     Ok(ResponseData {

+ 4 - 4
core/tauri/src/api/ipc.rs

@@ -242,22 +242,22 @@ mod test {
     }
 
     let raw_str = "T".repeat(MIN_JSON_PARSE_LEN);
-    assert_eq!(serialize_js(&raw_str).unwrap(), format!("\"{}\"", raw_str));
+    assert_eq!(serialize_js(&raw_str).unwrap(), format!("\"{raw_str}\""));
 
     assert_eq!(
       serialize_js(&JsonObj {
         value: raw_str.clone()
       })
       .unwrap(),
-      format!("JSON.parse('{{\"value\":\"{}\"}}')", raw_str)
+      format!("JSON.parse('{{\"value\":\"{raw_str}\"}}')")
     );
 
     assert_eq!(
       serialize_js(&JsonObj {
-        value: format!("\"{}\"", raw_str)
+        value: format!("\"{raw_str}\"")
       })
       .unwrap(),
-      format!("JSON.parse('{{\"value\":\"\\\\\"{}\\\\\"\"}}')", raw_str)
+      format!("JSON.parse('{{\"value\":\"\\\\\"{raw_str}\\\\\"\"}}')")
     );
 
     let dangerous_json = RawValue::from_string(

+ 1 - 1
core/tauri/src/api/shell.rs

@@ -112,5 +112,5 @@ pub fn open<P: AsRef<str>>(
 ) -> crate::api::Result<()> {
   scope
     .open(path.as_ref(), with)
-    .map_err(|err| crate::api::Error::Shell(format!("failed to open: {}", err)))
+    .map_err(|err| crate::api::Error::Shell(format!("failed to open: {err}")))
 }

+ 2 - 3
core/tauri/src/app.rs

@@ -868,7 +868,7 @@ impl<R: Runtime> App<R> {
     self.runtime.take().unwrap().run(move |event| match event {
       RuntimeRunEvent::Ready => {
         if let Err(e) = setup(&mut self) {
-          panic!("Failed to setup app: {}", e);
+          panic!("Failed to setup app: {e}");
         }
         on_event_loop_event(
           &app_handle,
@@ -1290,8 +1290,7 @@ impl<R: Runtime> Builder<R> {
     let type_name = std::any::type_name::<T>();
     assert!(
       self.state.set(state),
-      "state for type '{}' is already being managed",
-      type_name
+      "state for type '{type_name}' is already being managed",
     );
     self
   }

+ 1 - 2
core/tauri/src/endpoints.rs

@@ -238,8 +238,7 @@ pub(crate) fn handle<R: Runtime>(
         if let Some(unknown_variant_name) = s.next() {
           if unknown_variant_name == module {
             return resolver.reject(format!(
-              "The `{}` module is not enabled. You must enable one of its APIs in the allowlist.",
-              module
+              "The `{module}` module is not enabled. You must enable one of its APIs in the allowlist.",
             ));
           } else if module == "Window" {
             return resolver.reject(window::into_allowlist_error(unknown_variant_name).to_string());

+ 1 - 1
core/tauri/src/endpoints/event.rs

@@ -138,7 +138,7 @@ impl Cmd {
         serde_json::to_string(&p)
           .map_err(|e| {
             #[cfg(debug_assertions)]
-            eprintln!("{}", e);
+            eprintln!("{e}");
             e
           })
           .ok()

+ 2 - 2
core/tauri/src/endpoints/shell.rs

@@ -135,7 +135,7 @@ impl Cmd {
         Ok(cmd) => cmd,
         Err(e) => {
           #[cfg(debug_assertions)]
-          eprintln!("{}", e);
+          eprintln!("{e}");
           return Err(crate::Error::ProgramNotAllowed(PathBuf::from(program)).into_anyhow());
         }
       }
@@ -154,7 +154,7 @@ impl Cmd {
         if let Some(encoding) = crate::api::process::Encoding::for_label(encoding.as_bytes()) {
           command = command.encoding(encoding);
         } else {
-          return Err(anyhow::anyhow!(format!("unknown encoding {}", encoding)));
+          return Err(anyhow::anyhow!(format!("unknown encoding {encoding}")));
         }
       }
       let (mut rx, child) = command.spawn()?;

+ 5 - 8
core/tauri/src/event.rs

@@ -232,7 +232,7 @@ mod test {
 
   // dummy event handler function
   fn event_fn(s: Event) {
-    println!("{:?}", s);
+    println!("{s:?}");
   }
 
   proptest! {
@@ -304,18 +304,15 @@ pub fn unlisten_js(listeners_object_name: String, event_name: String, event_id:
   format!(
     "
       (function () {{
-        const listeners = (window['{listeners}'] || {{}})['{event_name}']
+        const listeners = (window['{listeners_object_name}'] || {{}})['{event_name}']
         if (listeners) {{
-          const index = window['{listeners}']['{event_name}'].findIndex(e => e.id === {event_id})
+          const index = window['{listeners_object_name}']['{event_name}'].findIndex(e => e.id === {event_id})
           if (index > -1) {{
-            window['{listeners}']['{event_name}'].splice(index, 1)
+            window['{listeners_object_name}']['{event_name}'].splice(index, 1)
           }}
         }}
       }})()
     ",
-    listeners = listeners_object_name,
-    event_name = event_name,
-    event_id = event_id,
   )
 }
 
@@ -353,7 +350,7 @@ pub fn listen_js(
     event_id = event_id,
     window_label = if let Some(l) = window_label {
       crate::runtime::window::assert_label_is_valid(&l);
-      format!("'{}'", l)
+      format!("'{l}'")
     } else {
       "null".to_owned()
     },

+ 1 - 1
core/tauri/src/hooks.rs

@@ -99,7 +99,7 @@ impl InvokeError {
   /// Create an [`InvokeError`] as a string of the [`anyhow::Error`] message.
   #[inline(always)]
   pub fn from_anyhow(error: anyhow::Error) -> Self {
-    Self(JsonValue::String(format!("{:#}", error)))
+    Self(JsonValue::String(format!("{error:#}")))
   }
 }
 

+ 9 - 14
core/tauri/src/lib.rs

@@ -470,8 +470,7 @@ impl TryFrom<Icon> for runtime::Icon {
           })
         }
         _ => panic!(
-          "image `{}` extension not supported; please file a Tauri feature request. `png` or `ico` icons are supported with the `icon-png` and `icon-ico` feature flags",
-          extension
+          "image `{extension}` extension not supported; please file a Tauri feature request. `png` or `ico` icons are supported with the `icon-png` and `icon-ico` feature flags"
         ),
       }
       }
@@ -875,8 +874,8 @@ mod tests {
     let lib_code = read_to_string(manifest_dir.join("src/lib.rs")).expect("failed to read lib.rs");
 
     for f in get_manifest().features.keys() {
-      if !(f.starts_with("__") || f == "default" || lib_code.contains(&format!("*{}**", f))) {
-        panic!("Feature {} is not documented", f);
+      if !(f.starts_with("__") || f == "default" || lib_code.contains(&format!("*{f}**"))) {
+        panic!("Feature {f} is not documented");
       }
     }
   }
@@ -888,8 +887,7 @@ mod tests {
     for checked_feature in checked_features {
       if !manifest.features.iter().any(|(f, _)| f == checked_feature) {
         panic!(
-          "Feature {} was checked in the alias build step but it does not exist in core/tauri/Cargo.toml",
-          checked_feature
+          "Feature {checked_feature} was checked in the alias build step but it does not exist in core/tauri/Cargo.toml"
         );
       }
     }
@@ -925,24 +923,21 @@ mod tests {
       let module = module_all_feature.replace("-all", "");
       assert!(
         checked_features.contains(&module_all_feature.as_str()),
-        "`{}` is not aliased",
-        module
+        "`{module}` is not aliased"
       );
 
-      let module_prefix = format!("{}-", module);
+      let module_prefix = format!("{module}-");
       // we assume that module features are the ones that start with `<module>-`
       // though it's not 100% accurate, we have an allowed list to fix it
       let module_features = manifest
         .features
-        .iter()
-        .map(|(f, _)| f)
+        .keys()
         .filter(|f| f.starts_with(&module_prefix));
       for module_feature in module_features {
         assert!(
           allowed.contains(&module_feature.as_str())
             || checked_features.contains(&module_feature.as_str()),
-          "`{}` is not aliased",
-          module_feature
+          "`{module_feature}` is not aliased"
         );
       }
     }
@@ -970,7 +965,7 @@ mod test_utils {
     fn check_spawn_task(task in "[a-z]+") {
       // create dummy task function
       let dummy_task = async move {
-        format!("{}-run-dummy-task", task);
+        format!("{task}-run-dummy-task");
       };
       // call spawn
       crate::async_runtime::spawn(dummy_task);

+ 6 - 7
core/tauri/src/manager.rs

@@ -179,7 +179,7 @@ fn replace_csp_nonce(
   if !(nonces.is_empty() && hashes.is_empty()) {
     let nonce_sources = nonces
       .into_iter()
-      .map(|n| format!("'nonce-{}'", n))
+      .map(|n| format!("'nonce-{n}'"))
       .collect::<Vec<String>>();
     let sources = csp.entry(directive.into()).or_insert_with(Default::default);
     let self_source = "'self'".to_string();
@@ -487,7 +487,7 @@ impl<R: Runtime> WindowManager<R> {
           window_url.scheme(),
           window_url.host().unwrap(),
           if let Some(port) = window_url.port() {
-            format!(":{}", port)
+            format!(":{port}")
           } else {
             "".into()
           }
@@ -713,8 +713,8 @@ impl<R: Runtime> WindowManager<R> {
     } = &self.inner.pattern
     {
       let assets = assets.clone();
-      let schema_ = schema.clone();
-      let url_base = format!("{}://localhost", schema_);
+      let _schema_ = schema.clone();
+      let url_base = format!("{schema}://localhost");
       let aes_gcm_key = *crypto_keys.aes_gcm().raw();
 
       pending.register_uri_scheme_protocol(schema, move |request| {
@@ -813,7 +813,7 @@ impl<R: Runtime> WindowManager<R> {
     let asset_response = assets
       .get(&path.as_str().into())
       .or_else(|| {
-        eprintln!("Asset `{}` not found; fallback to {}.html", path, path);
+        eprintln!("Asset `{path}` not found; fallback to {path}.html");
         let fallback = format!("{}.html", path.as_str()).into();
         let asset = assets.get(&fallback);
         asset_path = fallback;
@@ -1500,8 +1500,7 @@ fn on_window_event<R: Runtime>(
       let windows = windows_map.values();
       for window in windows {
         window.eval(&format!(
-          r#"(function () {{ const metadata = window.__TAURI_METADATA__; if (metadata != null) {{ metadata.__windows = window.__TAURI_METADATA__.__windows.filter(w => w.label !== "{}"); }} }})()"#,
-          label
+          r#"(function () {{ const metadata = window.__TAURI_METADATA__; if (metadata != null) {{ metadata.__windows = window.__TAURI_METADATA__.__windows.filter(w => w.label !== "{label}"); }} }})()"#,
         ))?;
       }
     }

+ 2 - 2
core/tauri/src/pattern.rs

@@ -87,8 +87,8 @@ pub(crate) struct PatternJavascript {
 #[allow(dead_code)]
 pub(crate) fn format_real_schema(schema: &str) -> String {
   if cfg!(windows) || cfg!(target_os = "android") {
-    format!("https://{}.localhost", schema)
+    format!("https://{schema}.localhost")
   } else {
-    format!("{}://localhost", schema)
+    format!("{schema}://localhost")
   }
 }

+ 2 - 4
core/tauri/src/plugin.rs

@@ -545,7 +545,7 @@ impl<R: Runtime> PluginStore<R> {
       .values()
       .filter_map(|p| p.initialization_script())
       .fold(String::new(), |acc, script| {
-        format!("{}\n(function () {{ {} }})();", acc, script)
+        format!("{acc}\n(function () {{ {script} }})();")
       })
   }
 
@@ -586,9 +586,7 @@ impl<R: Runtime> PluginStore<R> {
         .unwrap_or_else(String::new);
       plugin.extend_api(invoke);
     } else {
-      invoke
-        .resolver
-        .reject(format!("plugin {} not found", target));
+      invoke.resolver.reject(format!("plugin {target} not found"));
     }
   }
 }

+ 1 - 1
core/tauri/src/scope/http.rs

@@ -21,7 +21,7 @@ impl Scope {
         .iter()
         .map(|url| {
           glob::Pattern::new(url.as_str())
-            .unwrap_or_else(|_| panic!("scoped URL is not a valid glob pattern: `{}`", url))
+            .unwrap_or_else(|_| panic!("scoped URL is not a valid glob pattern: `{url}`"))
         })
         .collect(),
     }

+ 13 - 15
core/tauri/src/updater/core.rs

@@ -96,7 +96,7 @@ impl<'de> Deserialize<'de> for RemoteRelease {
     let pub_date = if let Some(date) = release.pub_date {
       Some(
         OffsetDateTime::parse(&date, &time::format_description::well_known::Rfc3339)
-          .map_err(|e| DeError::custom(format!("invalid value for `pub_date`: {}", e)))?,
+          .map_err(|e| DeError::custom(format!("invalid value for `pub_date`: {e}")))?,
       )
     } else {
       None
@@ -336,7 +336,7 @@ impl<R: Runtime> UpdateBuilder<R> {
       (target.clone(), target)
     } else {
       let target = get_updater_target().ok_or(Error::UnsupportedOs)?;
-      (target.to_string(), format!("{}-{}", target, arch))
+      (target.to_string(), format!("{target}-{arch}"))
     };
 
     // Get the extract_path from the provided executable_path
@@ -1049,14 +1049,13 @@ mod test {
     format!(
       r#"
         {{
-          "name": "v{}",
+          "name": "v{version}",
           "notes": "This is the latest version! Once updated you shouldn't see this prompt.",
           "pub_date": "2020-06-25T14:14:19Z",
-          "signature": "{}",
-          "url": "{}"
+          "signature": "{public_signature}",
+          "url": "{download_url}"
         }}
-      "#,
-      version, public_signature, download_url
+      "#
     )
   }
 
@@ -1069,15 +1068,14 @@ mod test {
     format!(
       r#"
         {{
-          "name": "v{}",
+          "name": "v{version}",
           "notes": "This is the latest version! Once updated you shouldn't see this prompt.",
           "pub_date": "2020-06-25T14:14:19Z",
-          "signature": "{}",
-          "url": "{}",
-          "with_elevated_task": {}
+          "signature": "{public_signature}",
+          "url": "{download_url}",
+          "with_elevated_task": {with_elevated_task}
         }}
-      "#,
-      version, public_signature, download_url, with_elevated_task
+      "#
     )
   }
 
@@ -1515,7 +1513,7 @@ mod test {
     }"#;
 
     fn missing_field_error(field: &str) -> String {
-      format!("the `{}` field was not set on the updater response", field)
+      format!("the `{field}` field was not set on the updater response")
     }
 
     let test_cases = [
@@ -1547,7 +1545,7 @@ mod test {
         .target("test-target")
         .build());
       if let Err(e) = check_update {
-        println!("ERROR: {}, expected: {}", e, error);
+        println!("ERROR: {e}, expected: {error}");
         assert!(e.to_string().contains(&error));
       } else {
         panic!("unexpected Ok response");

+ 2 - 2
core/tauri/src/updater/mod.rs

@@ -109,7 +109,7 @@ pub const EVENT_STATUS_UPTODATE: &str = "UPTODATE";
 /// Gets the target string used on the updater.
 pub fn target() -> Option<String> {
   if let (Some(target), Some(arch)) = (core::get_updater_target(), core::get_updater_arch()) {
-    Some(format!("{}-{}", target, arch))
+    Some(format!("{target}-{arch}"))
   } else {
     None
   }
@@ -565,7 +565,7 @@ async fn prompt_for_install<R: Runtime>(
   // something more conventional.
   let should_install = ask(
     parent_window,
-    format!(r#"A new version of {} is available! "#, app_name),
+    format!(r#"A new version of {app_name} is available! "#),
     format!(
       r#"{} {} is now available -- you have {}.
 

+ 2 - 2
core/tests/app-updater/src/main.rs

@@ -15,13 +15,13 @@ fn main() {
         match handle.updater().check().await {
           Ok(update) => {
             if let Err(e) = update.download_and_install().await {
-              println!("{}", e);
+              println!("{e}");
               std::process::exit(1);
             }
             std::process::exit(0);
           }
           Err(e) => {
-            println!("{}", e);
+            println!("{e}");
             std::process::exit(1);
           }
         }

+ 3 - 4
core/tests/app-updater/tests/update.rs

@@ -55,12 +55,12 @@ fn get_cli_bin_path(cli_dir: &Path, debug: bool) -> Option<PathBuf> {
 }
 
 fn build_app(cli_bin_path: &Path, cwd: &Path, config: &Config, bundle_updater: bool) {
-  let mut command = Command::new(&cli_bin_path);
+  let mut command = Command::new(cli_bin_path);
   command
     .args(["build", "--debug", "--verbose"])
     .arg("--config")
     .arg(serde_json::to_string(config).unwrap())
-    .current_dir(&cwd);
+    .current_dir(cwd);
 
   #[cfg(windows)]
   command.args(["--bundles", "msi"]);
@@ -88,8 +88,7 @@ fn build_app(cli_bin_path: &Path, cwd: &Path, config: &Config, bundle_updater: b
 #[cfg(target_os = "linux")]
 fn bundle_path(root_dir: &Path, version: &str) -> PathBuf {
   root_dir.join(format!(
-    "target/debug/bundle/appimage/app-updater_{}_amd64.AppImage",
-    version
+    "target/debug/bundle/appimage/app-updater_{version}_amd64.AppImage"
   ))
 }
 

+ 1 - 1
core/tests/restart/src/main.rs

@@ -24,7 +24,7 @@ fn main() {
       env.args.clear();
       tauri::api::process::restart(&env)
     }
-    Some(invalid) => panic!("only argument `restart` is allowed, {} is invalid", invalid),
+    Some(invalid) => panic!("only argument `restart` is allowed, {invalid} is invalid"),
     None => {}
   };
 }

+ 1 - 1
core/tests/restart/tests/restart.rs

@@ -32,7 +32,7 @@ fn symlink_runner(create_symlinks: impl Fn(&Path) -> io::Result<Symlink>) -> Res
   if cfg!(windows) {
     compiled_binary.set_extension("exe");
   }
-  println!("{:?}", compiled_binary);
+  println!("{compiled_binary:?}");
 
   // set up all the temporary file paths
   let temp = tempfile::TempDir::new()?;

+ 1 - 1
examples/commands/commands.rs

@@ -18,7 +18,7 @@ pub fn resolver(_argument: String) {}
 
 #[command]
 pub fn simple_command(the_argument: String) {
-  println!("{}", the_argument);
+  println!("{the_argument}");
 }
 
 #[command]

+ 13 - 13
examples/commands/main.rs

@@ -37,12 +37,12 @@ fn window_label(window: Window) {
 
 #[command]
 async fn async_simple_command(the_argument: String) {
-  println!("{}", the_argument);
+  println!("{the_argument}");
 }
 
 #[command(rename_all = "snake_case")]
 async fn async_simple_command_snake(the_argument: String) {
-  println!("{}", the_argument);
+  println!("{the_argument}");
 }
 
 #[command]
@@ -57,7 +57,7 @@ async fn async_stateful_command(
 
 #[command(async)]
 fn future_simple_command(the_argument: String) -> impl std::future::Future<Output = ()> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   std::future::ready(())
 }
 
@@ -65,7 +65,7 @@ fn future_simple_command(the_argument: String) -> impl std::future::Future<Outpu
 fn future_simple_command_with_return(
   the_argument: String,
 ) -> impl std::future::Future<Output = String> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   std::future::ready(the_argument)
 }
 
@@ -73,7 +73,7 @@ fn future_simple_command_with_return(
 fn future_simple_command_with_result(
   the_argument: String,
 ) -> impl std::future::Future<Output = Result<String, ()>> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   std::future::ready(Ok(the_argument))
 }
 
@@ -93,7 +93,7 @@ fn force_async_with_result(the_argument: &str) -> Result<&str, MyError> {
 
 #[command(async, rename_all = "snake_case")]
 fn future_simple_command_snake(the_argument: String) -> impl std::future::Future<Output = ()> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   std::future::ready(())
 }
 
@@ -101,7 +101,7 @@ fn future_simple_command_snake(the_argument: String) -> impl std::future::Future
 fn future_simple_command_with_return_snake(
   the_argument: String,
 ) -> impl std::future::Future<Output = String> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   std::future::ready(the_argument)
 }
 
@@ -109,7 +109,7 @@ fn future_simple_command_with_return_snake(
 fn future_simple_command_with_result_snake(
   the_argument: String,
 ) -> impl std::future::Future<Output = Result<String, ()>> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   std::future::ready(Ok(the_argument))
 }
 
@@ -129,7 +129,7 @@ fn force_async_with_result_snake(the_argument: &str) -> Result<&str, MyError> {
 
 #[command]
 fn simple_command_with_result(the_argument: String) -> Result<String, MyError> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   (!the_argument.is_empty())
     .then(|| the_argument)
     .ok_or(MyError::FooError)
@@ -148,7 +148,7 @@ fn stateful_command_with_result(
 
 #[command(rename_all = "snake_case")]
 fn simple_command_with_result_snake(the_argument: String) -> Result<String, MyError> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   (!the_argument.is_empty())
     .then(|| the_argument)
     .ok_or(MyError::FooError)
@@ -167,7 +167,7 @@ fn stateful_command_with_result_snake(
 
 #[command]
 async fn async_simple_command_with_result(the_argument: String) -> Result<String, MyError> {
-  println!("{}", the_argument);
+  println!("{the_argument}");
   Ok(the_argument)
 }
 
@@ -195,7 +195,7 @@ struct Person<'a> {
 
 #[command]
 fn command_arguments_struct(Person { name, age }: Person<'_>) {
-  println!("received person struct with name: {} | age: {}", name, age)
+  println!("received person struct with name: {name} | age: {age}")
 }
 
 #[derive(Deserialize)]
@@ -203,7 +203,7 @@ struct InlinePerson<'a>(&'a str, u8);
 
 #[command]
 fn command_arguments_tuple_struct(InlinePerson(name, age): InlinePerson<'_>) {
-  println!("received person tuple with name: {} | age: {}", name, age)
+  println!("received person tuple with name: {name} | age: {age}")
 }
 
 #[command]

+ 1 - 1
examples/multiwindow/main.rs

@@ -14,7 +14,7 @@ fn main() {
     .on_page_load(|window, _payload| {
       let label = window.label().to_string();
       window.listen("clicked".to_string(), move |_payload| {
-        println!("got 'clicked' event on window '{}'", label);
+        println!("got 'clicked' event on window '{label}'");
       });
     })
     .setup(|app| {

+ 1 - 1
examples/parent-window/main.rs

@@ -28,7 +28,7 @@ fn main() {
     .on_page_load(|window, _payload| {
       let label = window.label().to_string();
       window.listen("clicked".to_string(), move |_payload| {
-        println!("got 'clicked' event on window '{}'", label);
+        println!("got 'clicked' event on window '{label}'");
       });
     })
     .invoke_handler(tauri::generate_handler![create_child_window])

+ 1 - 1
examples/streaming/main.rs

@@ -23,7 +23,7 @@ fn main() {
   if !video_file.exists() {
     // Downloading with curl this saves us from adding
     // a Rust HTTP client dependency.
-    println!("Downloading {}", video_url);
+    println!("Downloading {video_url}");
     let status = Command::new("curl")
       .arg("-L")
       .arg("-o")

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

@@ -117,7 +117,7 @@ pub fn generate_data(
 
   for bin in settings.binaries() {
     let bin_path = settings.binary_path(bin);
-    common::copy_file(&bin_path, &bin_dir.join(bin.name()))
+    common::copy_file(&bin_path, bin_dir.join(bin.name()))
       .with_context(|| format!("Failed to copy binary from {:?}", bin_path))?;
   }
 

+ 4 - 1
tooling/bundler/src/bundle/path_utils.rs

@@ -206,7 +206,10 @@ where
     let mut work = true;
 
     while work {
-      result_copy = copy_file(&file, &path, &file_options);
+      #[allow(clippy::needless_borrow)]
+      {
+        result_copy = copy_file(&file, &path, &file_options);
+      }
       match result_copy {
         Ok(val) => {
           result += val;

+ 2 - 2
tooling/bundler/src/bundle/settings.rs

@@ -655,7 +655,7 @@ impl Settings {
           .to_string_lossy()
           .replace(&format!("-{}", self.target), ""),
       );
-      common::copy_file(&src, &dest)?;
+      common::copy_file(&src, dest)?;
     }
     Ok(())
   }
@@ -665,7 +665,7 @@ impl Settings {
     for src in self.resource_files() {
       let src = src?;
       let dest = path.join(tauri_utils::resources::resource_relpath(&src));
-      common::copy_file(&src, &dest)?;
+      common::copy_file(&src, dest)?;
     }
     Ok(())
   }

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

@@ -240,7 +240,7 @@ pub fn setup(options: &mut Options, mobile: bool) -> Result<AppInterface> {
   options.config = merge_config;
 
   let tauri_path = tauri_dir();
-  set_current_dir(&tauri_path).with_context(|| "failed to change current working directory")?;
+  set_current_dir(tauri_path).with_context(|| "failed to change current working directory")?;
 
   let config = get_config(options.config.as_deref())?;
 

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

@@ -130,7 +130,7 @@ pub fn setup(options: &mut Options, mobile: bool) -> Result<AppInterface> {
     None
   };
 
-  set_current_dir(&tauri_path).with_context(|| "failed to change current working directory")?;
+  set_current_dir(tauri_path).with_context(|| "failed to change current working directory")?;
 
   let config = get_config(options.config.as_deref())?;
 

+ 4 - 4
tooling/cli/src/helpers/updater_signature.rs

@@ -35,8 +35,8 @@ pub fn generate_key(password: Option<String>) -> crate::Result<KeyPair> {
   let pk_box_str = pk.to_box().unwrap().to_string();
   let sk_box_str = sk.to_box(None).unwrap().to_string();
 
-  let encoded_pk = encode(&pk_box_str);
-  let encoded_sk = encode(&sk_box_str);
+  let encoded_pk = encode(pk_box_str);
+  let encoded_sk = encode(sk_box_str);
 
   Ok(KeyPair {
     pk: encoded_pk,
@@ -46,7 +46,7 @@ pub fn generate_key(password: Option<String>) -> crate::Result<KeyPair> {
 
 /// Transform a base64 String to readable string for the main signer
 pub fn decode_key(base64_key: String) -> crate::Result<String> {
-  let decoded_str = &decode(&base64_key)?[..];
+  let decoded_str = &decode(base64_key)?[..];
   Ok(String::from(str::from_utf8(decoded_str)?))
 }
 
@@ -128,7 +128,7 @@ where
     Some("signature from tauri secret key"),
   )?;
 
-  let encoded_signature = encode(&signature_box.to_string());
+  let encoded_signature = encode(signature_box.to_string());
   signature_box_writer.write_all(encoded_signature.as_bytes())?;
   signature_box_writer.flush()?;
   Ok((fs::canonicalize(&signature_path)?, signature_box))

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

@@ -450,7 +450,7 @@ fn crate_version(
                 v
               } else if let Some(p) = p.path {
                 let manifest_path = tauri_dir.join(&p).join("Cargo.toml");
-                let v = match read_to_string(&manifest_path)
+                let v = match read_to_string(manifest_path)
                   .map_err(|_| ())
                   .and_then(|m| toml::from_str::<CargoManifest>(&m).map_err(|_| ()))
                 {

+ 1 - 1
tooling/cli/src/interface/rust.rs

@@ -654,7 +654,7 @@ impl AppSettings for RustAppSettings {
     }
     .into();
 
-    Ok(out_dir.join(bin_name).with_extension(&binary_extension))
+    Ok(out_dir.join(bin_name).with_extension(binary_extension))
   }
 
   fn get_binaries(&self, config: &Config, target: &str) -> crate::Result<Vec<BundleBinary>> {

+ 1 - 1
tooling/cli/src/interface/rust/desktop.rs

@@ -330,7 +330,7 @@ fn build_command(
     args.push(target);
   }
 
-  let mut build_cmd = Command::new(&runner);
+  let mut build_cmd = Command::new(runner);
   build_cmd.arg("build");
   build_cmd.args(args);
 

+ 1 - 1
tooling/cli/src/mobile/android/build.rs

@@ -120,7 +120,7 @@ fn run_build(
     ..Default::default()
   })?;
   let out_dir = bin_path.parent().unwrap();
-  let _lock = flock::open_rw(&out_dir.join("lock").with_extension("android"), "Android")?;
+  let _lock = flock::open_rw(out_dir.join("lock").with_extension("android"), "Android")?;
 
   let cli_options = CliOptions {
     features: build_options.features.clone(),

+ 1 - 1
tooling/cli/src/mobile/android/dev.rs

@@ -104,7 +104,7 @@ fn run_dev(
     ..Default::default()
   })?;
   let out_dir = bin_path.parent().unwrap();
-  let _lock = flock::open_rw(&out_dir.join("lock").with_extension("android"), "Android")?;
+  let _lock = flock::open_rw(out_dir.join("lock").with_extension("android"), "Android")?;
 
   let env = env()?;
   init_dot_cargo(app, Some((&env, config)))?;

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

@@ -56,7 +56,7 @@ impl Options {
 
 pub fn command(mut options: Options) -> Result<()> {
   options.load();
-  let template_target_path = PathBuf::from(options.directory).join(&format!(
+  let template_target_path = PathBuf::from(options.directory).join(format!(
     "tauri-plugin-{}",
     AsKebabCase(&options.plugin_name)
   ));