Skip to content

Commit e9c9c4d

Browse files
authored
feat: derive Clone for PathResolver (#12529)
closes #12528
1 parent abdd558 commit e9c9c4d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

Diff for: .changes/path-resolver-clone.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": "patch:enhance"
3+
---
4+
5+
Derive `Clone` for `PathResolver` struct.

Diff for: crates/tauri/src/path/android.rs

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ use std::path::PathBuf;
99
/// A helper class to access the mobile path APIs.
1010
pub struct PathResolver<R: Runtime>(pub(crate) PluginHandle<R>);
1111

12+
impl<R: Runtime> Clone for PathResolver<R> {
13+
fn clone(&self) -> Self {
14+
Self(self.0.clone())
15+
}
16+
}
17+
1218
#[derive(serde::Deserialize)]
1319
struct PathResponse {
1420
path: PathBuf,

Diff for: crates/tauri/src/path/desktop.rs

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ use std::path::PathBuf;
99
/// The path resolver is a helper class for general and application-specific path APIs.
1010
pub struct PathResolver<R: Runtime>(pub(crate) AppHandle<R>);
1111

12+
impl<R: Runtime> Clone for PathResolver<R> {
13+
fn clone(&self) -> Self {
14+
Self(self.0.clone())
15+
}
16+
}
17+
1218
impl<R: Runtime> PathResolver<R> {
1319
/// Returns the path to the user's audio directory.
1420
///

0 commit comments

Comments
 (0)