Fix build on wasm with serialization feature`

serde` only implements `Serialize` for `OsString` on
unix and windows.
This commit is contained in:
Andrew Hickman
2020-09-02 18:23:31 +01:00
parent 7ae8097d05
commit d9cf655f30
+5 -1
View File
@@ -326,7 +326,11 @@ where
/// A file that is stored in the database.
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serialization", derive(Deserialize, Serialize))]
// `Serialize` is only implemented on `OsString` for windows/unix
#[cfg_attr(
all(feature = "serialization", any(windows, unix)),
derive(Deserialize, Serialize)
)]
struct File<Source> {
/// The name of the file.
name: OsString,