From d7ffa7f95e6dbf2f667b124888e4f11241fd3316 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 15 Dec 2022 18:28:44 -0300 Subject: [PATCH] chore: addition to previous commit --- core/config-schema/build.rs | 2 +- core/tauri-build/src/lib.rs | 2 +- core/tauri/src/api/file/extract.rs | 2 +- core/tauri/src/api/http.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/config-schema/build.rs b/core/config-schema/build.rs index 0c5fe9898..31fc2aba9 100644 --- a/core/config-schema/build.rs +++ b/core/config-schema/build.rs @@ -17,7 +17,7 @@ pub fn main() -> Result<(), Box> { crate_dir.join("schema.json"), crate_dir.join("../../tooling/cli/schema.json"), ] { - let mut schema_file = BufWriter::new(File::create(&file)?); + let mut schema_file = BufWriter::new(File::create(file)?); write!(schema_file, "{schema_str}")?; } diff --git a/core/tauri-build/src/lib.rs b/core/tauri-build/src/lib.rs index 2b5c2251c..1c4e701fe 100644 --- a/core/tauri-build/src/lib.rs +++ b/core/tauri-build/src/lib.rs @@ -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(()) } diff --git a/core/tauri/src/api/file/extract.rs b/core/tauri/src/api/file/extract.rs index 4625981a0..9e2eb76e8 100644 --- a/core/tauri/src/api/file/extract.rs +++ b/core/tauri/src/api/file/extract.rs @@ -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 { diff --git a/core/tauri/src/api/http.rs b/core/tauri/src/api/http.rs index a55529ddd..7b9614c19 100644 --- a/core/tauri/src/api/http.rs +++ b/core/tauri/src/api/http.rs @@ -661,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 {