Skip to content

Commit

Permalink
fix serde_path
Browse files Browse the repository at this point in the history
  • Loading branch information
zao111222333 committed Feb 12, 2025
1 parent b5febd6 commit 77f2f67
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion serde_derive/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,11 @@ fn borrowed_lifetimes(cont: &Container) -> BorrowedLifetimes {
}

fn validate_body(cont: &Container, body: Stmts) -> TokenStream {
let serde = cont.attrs.serde_path();
if let Some(validate) = cont.attrs.validate() {
quote! {
let body = { #body }?;
#validate(&body).map_err(_serde::de::Error::custom)?;
#validate(&body).map_err(#serde::de::Error::custom)?;
Ok(body)
}
} else {
Expand Down

0 comments on commit 77f2f67

Please sign in to comment.