From d9cf655f300dc1f40896a5bc1ef19f7486a7c08d Mon Sep 17 00:00:00 2001 From: Andrew Hickman Date: Wed, 2 Sep 2020 18:23:31 +0100 Subject: [PATCH] Fix build on wasm with `serialization` feature` serde` only implements `Serialize` for `OsString` on unix and windows. --- codespan/src/file.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codespan/src/file.rs b/codespan/src/file.rs index 56c1742..2ab5fb3 100644 --- a/codespan/src/file.rs +++ b/codespan/src/file.rs @@ -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 { /// The name of the file. name: OsString,