Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #210 from knkski/scalar-tags-quoted
Browse files Browse the repository at this point in the history
Fixes tags being ignored for quoted scalars
  • Loading branch information
dtolnay committed Aug 26, 2021
2 parents e5c1113 + dd738cd commit 79edfdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/de.rs
Expand Up @@ -687,9 +687,7 @@ fn visit_scalar<'de, V>(
where
V: Visitor<'de>,
{
if style != TScalarStyle::Plain {
visitor.visit_str(v)
} else if let Some(TokenType::Tag(handle, suffix)) = tag {
if let Some(TokenType::Tag(handle, suffix)) = tag {
if handle == "!!" {
match suffix.as_ref() {
"bool" => match v.parse::<bool>() {
Expand All @@ -713,8 +711,10 @@ where
} else {
visitor.visit_str(v)
}
} else {
} else if style == TScalarStyle::Plain {
visit_untagged_str(visitor, v)
} else {
visitor.visit_str(v)
}
}

Expand Down

0 comments on commit 79edfdd

Please sign in to comment.