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

Fixes tags being ignored for quoted scalars #210

Merged
merged 1 commit into from Aug 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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