Skip to content

Commit

Permalink
Update serde_derive/src/de.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Mingun <[email protected]>
  • Loading branch information
zao111222333 and Mingun authored Feb 11, 2025
1 parent b82d4a9 commit da1d396
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions serde_derive/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ fn borrowed_lifetimes(cont: &Container) -> BorrowedLifetimes {
}

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

0 comments on commit da1d396

Please sign in to comment.