diff --git a/.changes/safepathbuf_into_pathbuf.md b/.changes/safepathbuf_into_pathbuf.md new file mode 100644 index 000000000..1a72fa205 --- /dev/null +++ b/.changes/safepathbuf_into_pathbuf.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:enhance +--- + +Implement retrieving inner PathBuf from SafePathBuf to ease using APIs that require an owned PathBuf diff --git a/crates/tauri/src/path/mod.rs b/crates/tauri/src/path/mod.rs index f504435c5..c00af5d8d 100644 --- a/crates/tauri/src/path/mod.rs +++ b/crates/tauri/src/path/mod.rs @@ -73,6 +73,12 @@ impl FromStr for SafePathBuf { } } +impl From for PathBuf { + fn from(path: SafePathBuf) -> Self { + path.0 + } +} + impl<'de> Deserialize<'de> for SafePathBuf { fn deserialize(deserializer: D) -> std::result::Result where