Use user provided Serialize and Deserialize macros
This commit is contained in:
parent
b644597e8c
commit
55ea832ba5
|
@ -17,6 +17,8 @@ mod macros;
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
// just tests that the macro compiles
|
||||
crate::query_def! {
|
||||
/// Foo doc.
|
||||
|
|
|
@ -102,7 +102,7 @@ macro_rules! query_def {
|
|||
) => {
|
||||
$(
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
$(#[$meta])
|
||||
*
|
||||
$vis struct $data {
|
||||
|
@ -115,7 +115,7 @@ macro_rules! query_def {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
$(#[$def_meta])
|
||||
*
|
||||
$vis struct $def {
|
||||
|
|
Loading…
Reference in New Issue