mirror of https://github.com/tauri-apps/tauri
feat: derive `serde::Serialize` for `SafePathBuf` (#10884)
This commit is contained in:
parent
976cad97c1
commit
0899e50831
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
"tauri": patch:feat
|
||||
---
|
||||
|
||||
Derive serde `Serialize` for `SafePathBuf`
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
"tauri": patch:enhance
|
||||
"tauri": patch:feat
|
||||
---
|
||||
|
||||
Add `FromStr` impl for `SafePathBuf`
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue