Use user provided Serialize and Deserialize macros
This commit is contained in:
parent
b644597e8c
commit
55ea832ba5
|
@ -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.
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue