Use user provided Serialize and Deserialize macros

This commit is contained in:
Michael Pfaff 2022-05-19 13:12:24 -04:00
parent b644597e8c
commit 55ea832ba5
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
2 changed files with 4 additions and 2 deletions

View File

@ -17,6 +17,8 @@ mod macros;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use serde::{Deserialize, Serialize};
// just tests that the macro compiles // just tests that the macro compiles
crate::query_def! { crate::query_def! {
/// Foo doc. /// Foo doc.

View File

@ -102,7 +102,7 @@ macro_rules! query_def {
) => { ) => {
$( $(
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
$(#[$meta]) $(#[$meta])
* *
$vis struct $data { $vis struct $data {
@ -115,7 +115,7 @@ macro_rules! query_def {
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
$(#[$def_meta]) $(#[$def_meta])
* *
$vis struct $def { $vis struct $def {