From 6230404fcb1fc402bcf26f41d4b3dae00ea942eb Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 27 Feb 2025 11:13:35 +0100 Subject: [PATCH] clippy --- plugins/deep-link/src/lib.rs | 6 +++--- plugins/fs/src/file_path.rs | 8 ++------ plugins/opener/src/lib.rs | 6 ++---- plugins/shell/src/lib.rs | 3 +-- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/plugins/deep-link/src/lib.rs b/plugins/deep-link/src/lib.rs index c259e6b2..46dfe04f 100644 --- a/plugins/deep-link/src/lib.rs +++ b/plugins/deep-link/src/lib.rs @@ -267,16 +267,16 @@ mod imp { let key_reg = CURRENT_USER.create(&key_base)?; key_reg.set_string( "", - &format!("URL:{} protocol", self.app.config().identifier), + format!("URL:{} protocol", self.app.config().identifier), )?; key_reg.set_string("URL Protocol", "")?; let icon_reg = CURRENT_USER.create(format!("{key_base}\\DefaultIcon"))?; - icon_reg.set_string("", &format!("{exe},0"))?; + icon_reg.set_string("", format!("{exe},0"))?; let cmd_reg = CURRENT_USER.create(format!("{key_base}\\shell\\open\\command"))?; - cmd_reg.set_string("", &format!("\"{exe}\" \"%1\""))?; + cmd_reg.set_string("", format!("\"{exe}\" \"%1\""))?; Ok(()) } diff --git a/plugins/fs/src/file_path.rs b/plugins/fs/src/file_path.rs index 735fc105..f3282e37 100644 --- a/plugins/fs/src/file_path.rs +++ b/plugins/fs/src/file_path.rs @@ -54,9 +54,7 @@ impl FilePath { pub fn into_path(self) -> Result { match self { Self::Url(url) => url - .to_file_path() - .map(PathBuf::from) - .map_err(|_| Error::InvalidPathUrl), + .to_file_path().map_err(|_| Error::InvalidPathUrl), Self::Path(p) => Ok(p), } } @@ -92,9 +90,7 @@ impl SafeFilePath { pub fn into_path(self) -> Result { match self { Self::Url(url) => url - .to_file_path() - .map(PathBuf::from) - .map_err(|_| Error::InvalidPathUrl), + .to_file_path().map_err(|_| Error::InvalidPathUrl), Self::Path(p) => Ok(p.as_ref().to_owned()), } } diff --git a/plugins/opener/src/lib.rs b/plugins/opener/src/lib.rs index 1cb78b86..854fe770 100644 --- a/plugins/opener/src/lib.rs +++ b/plugins/opener/src/lib.rs @@ -56,8 +56,7 @@ impl Opener { /// - **Android / iOS**: Always opens using default program. #[cfg(desktop)] pub fn open_url(&self, url: impl Into, with: Option>) -> Result<()> { - crate::open::open(url.into(), with.map(Into::into)).map_err(Into::into) - } + crate::open::open(url.into(), with.map(Into::into))} /// Open a url with a default or specific program. /// @@ -108,8 +107,7 @@ impl Opener { path: impl Into, with: Option>, ) -> Result<()> { - crate::open::open(path.into(), with.map(Into::into)).map_err(Into::into) - } + crate::open::open(path.into(), with.map(Into::into))} /// Open a path with a default or specific program. /// diff --git a/plugins/shell/src/lib.rs b/plugins/shell/src/lib.rs index 64cc6122..095e71c6 100644 --- a/plugins/shell/src/lib.rs +++ b/plugins/shell/src/lib.rs @@ -75,8 +75,7 @@ impl Shell { #[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")] #[allow(deprecated)] pub fn open(&self, path: impl Into, with: Option) -> Result<()> { - open::open(&self.open_scope, path.into(), with).map_err(Into::into) - } + open::open(&self.open_scope, path.into(), with)} /// Open a (url) path with a default or specific browser opening program. ///