Skip to content

Commit

Permalink
Fix some comments in parsing of from/try_from/into attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 10, 2023
1 parent 0e70f59 commit 183b917
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions serde_derive/src/internals/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,21 +490,21 @@ impl Container {
}
}

// Parse `#[serde(from = "Type")]
// Parse `#[serde(from = "Type")]`
Meta(NameValue(m)) if m.path == FROM => {
if let Ok(from_ty) = parse_lit_into_ty(cx, FROM, &m.lit) {
type_from.set_opt(&m.path, Some(from_ty));
}
}

// Parse `#[serde(try_from = "Type")]
// Parse `#[serde(try_from = "Type")]`
Meta(NameValue(m)) if m.path == TRY_FROM => {
if let Ok(try_from_ty) = parse_lit_into_ty(cx, TRY_FROM, &m.lit) {
type_try_from.set_opt(&m.path, Some(try_from_ty));
}
}

// Parse `#[serde(into = "Type")]
// Parse `#[serde(into = "Type")]`
Meta(NameValue(m)) if m.path == INTO => {
if let Ok(into_ty) = parse_lit_into_ty(cx, INTO, &m.lit) {
type_into.set_opt(&m.path, Some(into_ty));
Expand Down

0 comments on commit 183b917

Please sign in to comment.