Skip to content

Commit 6230404

Browse files
committed
clippy
1 parent 346c9a9 commit 6230404

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

plugins/deep-link/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,16 @@ mod imp {
267267
let key_reg = CURRENT_USER.create(&key_base)?;
268268
key_reg.set_string(
269269
"",
270-
&format!("URL:{} protocol", self.app.config().identifier),
270+
format!("URL:{} protocol", self.app.config().identifier),
271271
)?;
272272
key_reg.set_string("URL Protocol", "")?;
273273

274274
let icon_reg = CURRENT_USER.create(format!("{key_base}\\DefaultIcon"))?;
275-
icon_reg.set_string("", &format!("{exe},0"))?;
275+
icon_reg.set_string("", format!("{exe},0"))?;
276276

277277
let cmd_reg = CURRENT_USER.create(format!("{key_base}\\shell\\open\\command"))?;
278278

279-
cmd_reg.set_string("", &format!("\"{exe}\" \"%1\""))?;
279+
cmd_reg.set_string("", format!("\"{exe}\" \"%1\""))?;
280280

281281
Ok(())
282282
}

plugins/fs/src/file_path.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ impl FilePath {
5454
pub fn into_path(self) -> Result<PathBuf> {
5555
match self {
5656
Self::Url(url) => url
57-
.to_file_path()
58-
.map(PathBuf::from)
59-
.map_err(|_| Error::InvalidPathUrl),
57+
.to_file_path().map_err(|_| Error::InvalidPathUrl),
6058
Self::Path(p) => Ok(p),
6159
}
6260
}
@@ -92,9 +90,7 @@ impl SafeFilePath {
9290
pub fn into_path(self) -> Result<PathBuf> {
9391
match self {
9492
Self::Url(url) => url
95-
.to_file_path()
96-
.map(PathBuf::from)
97-
.map_err(|_| Error::InvalidPathUrl),
93+
.to_file_path().map_err(|_| Error::InvalidPathUrl),
9894
Self::Path(p) => Ok(p.as_ref().to_owned()),
9995
}
10096
}

plugins/opener/src/lib.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ impl<R: Runtime> Opener<R> {
5656
/// - **Android / iOS**: Always opens using default program.
5757
#[cfg(desktop)]
5858
pub fn open_url(&self, url: impl Into<String>, with: Option<impl Into<String>>) -> Result<()> {
59-
crate::open::open(url.into(), with.map(Into::into)).map_err(Into::into)
60-
}
59+
crate::open::open(url.into(), with.map(Into::into))}
6160

6261
/// Open a url with a default or specific program.
6362
///
@@ -108,8 +107,7 @@ impl<R: Runtime> Opener<R> {
108107
path: impl Into<String>,
109108
with: Option<impl Into<String>>,
110109
) -> Result<()> {
111-
crate::open::open(path.into(), with.map(Into::into)).map_err(Into::into)
112-
}
110+
crate::open::open(path.into(), with.map(Into::into))}
113111

114112
/// Open a path with a default or specific program.
115113
///

plugins/shell/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ impl<R: Runtime> Shell<R> {
7575
#[deprecated(since = "2.1.0", note = "Use tauri-plugin-opener instead.")]
7676
#[allow(deprecated)]
7777
pub fn open(&self, path: impl Into<String>, with: Option<open::Program>) -> Result<()> {
78-
open::open(&self.open_scope, path.into(), with).map_err(Into::into)
79-
}
78+
open::open(&self.open_scope, path.into(), with)}
8079

8180
/// Open a (url) path with a default or specific browser opening program.
8281
///

0 commit comments

Comments
 (0)