Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
zao111222333 committed Feb 11, 2025
1 parent da1d396 commit b5febd6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions serde_derive/src/internals/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ pub struct Container {
remote: Option<syn::Path>,
identifier: Identifier,
serde_path: Option<syn::Path>,
vaildate: Option<syn::ExprPath>,
validate: Option<syn::ExprPath>,
is_packed: bool,
/// Error message generated when type can't be deserialized
expecting: Option<String>,
Expand Down Expand Up @@ -257,7 +257,7 @@ impl Container {
let mut remote = Attr::none(cx, REMOTE);
let mut field_identifier = BoolAttr::none(cx, FIELD_IDENTIFIER);
let mut variant_identifier = BoolAttr::none(cx, VARIANT_IDENTIFIER);
let mut vaildate = Attr::none(cx, VALIDATE);
let mut validate = Attr::none(cx, VALIDATE);
let mut serde_path = Attr::none(cx, CRATE);
let mut expecting = Attr::none(cx, EXPECTING);
let mut non_exhaustive = false;
Expand Down Expand Up @@ -491,7 +491,7 @@ impl Container {
} else if meta.path == VALIDATE {
// #[serde(validate = "...")]
if let Some(path) = parse_lit_into_expr_path(cx, VALIDATE, &meta)? {
vaildate.set(&meta.path, path);
validate.set(&meta.path, path);
}
} else if meta.path == EXPECTING {
// #[serde(expecting = "a message")]
Expand Down Expand Up @@ -546,7 +546,7 @@ impl Container {
remote: remote.get(),
identifier: decide_identifier(cx, item, field_identifier, variant_identifier),
serde_path: serde_path.get(),
vaildate: vaildate.get(),
validate: validate.get(),
is_packed,
expecting: expecting.get(),
non_exhaustive,
Expand Down Expand Up @@ -605,8 +605,8 @@ impl Container {
self.remote.as_ref()
}

pub fn vaildate(&self) -> Option<&syn::ExprPath> {
self.vaildate.as_ref()
pub fn validate(&self) -> Option<&syn::ExprPath> {
self.validate.as_ref()
}

pub fn is_packed(&self) -> bool {
Expand Down

0 comments on commit b5febd6

Please sign in to comment.