feat: derive `serde::Serialize` for `SafePathBuf` (#10884)

This commit is contained in:
Amr Bashir 2024-09-04 04:55:19 +03:00 committed by GitHub
parent 976cad97c1
commit 0899e50831
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 3 deletions

View File

@ -0,0 +1,6 @@
---
"tauri": patch:feat
---
Derive serde `Serialize` for `SafePathBuf`

View File

@ -1,5 +1,5 @@
---
"tauri": patch:enhance
"tauri": patch:feat
---
Add `FromStr` impl for `SafePathBuf`

View File

@ -9,7 +9,7 @@ use std::{
use crate::Runtime;
use serde::{de::Error as DeError, Deserialize, Deserializer};
use serde::{de::Error as DeError, Deserialize, Deserializer, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
pub(crate) mod plugin;
@ -27,7 +27,7 @@ pub use android::PathResolver;
pub use desktop::PathResolver;
/// A wrapper for [`PathBuf`] that prevents path traversal.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, Serialize)]
pub struct SafePathBuf(PathBuf);
impl SafePathBuf {