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,