Skip to content

Commit

Permalink
Merge pull request #30 from dtolnay/deprecated
Browse files Browse the repository at this point in the history
Suppress warning when deriving on deprecated type
  • Loading branch information
dtolnay authored Apr 8, 2024
2 parents dd7a48a + 376011d commit 4b32db8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub fn derive_serialize(input: TokenStream) -> TokenStream {
});

TokenStream::from(quote! {
#[allow(deprecated)]
impl serde::Serialize for #ident {
#[allow(clippy::use_self)]
fn serialize<S>(&self, serializer: S) -> ::core::result::Result<S::Ok, S::Error>
Expand Down Expand Up @@ -118,6 +119,7 @@ pub fn derive_deserialize(input: TokenStream) -> TokenStream {
};

TokenStream::from(quote! {
#[allow(deprecated)]
impl<'de> serde::Deserialize<'de> for #ident {
#[allow(clippy::use_self)]
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
Expand Down

0 comments on commit 4b32db8

Please sign in to comment.