Skip to content

Commit

Permalink
Fix a cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Aug 21, 2023
1 parent 6513123 commit 0043e53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions serde_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
)]
#![cfg_attr(all(test, exhaustive), feature(non_exhaustive_omitted_patterns_lint))]

extern crate proc_macro2;
extern crate quote;
extern crate syn;

Expand All @@ -84,15 +85,15 @@ mod pretend;
mod ser;
mod this;

#[cfg(proc_macro_derive(Serialize, attributes(serde)))]
#[proc_macro_derive(Serialize, attributes(serde))]
pub fn derive_serialize(input: TokenStream) -> TokenStream {
let mut input = parse_macro_input!(input as DeriveInput);
ser::expand_derive_serialize(&mut input)
.unwrap_or_else(syn::Error::into_compile_error)
.into()
}

#[cfg(proc_macro_derive(Deserialize, attributes(serde)))]
#[proc_macro_derive(Deserialize, attributes(serde))]
pub fn derive_deserialize(input: TokenStream) -> TokenStream {
let mut input = parse_macro_input!(input as DeriveInput);
de::expand_derive_deserialize(&mut input)
Expand Down

0 comments on commit 0043e53

Please sign in to comment.