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

Commit dd738cd

Browse files
committed
Fixes tags being ignored for quoted scalars
1 parent e5c1113 commit dd738cd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/de.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,7 @@ fn visit_scalar<'de, V>(
687687
where
688688
V: Visitor<'de>,
689689
{
690-
if style != TScalarStyle::Plain {
691-
visitor.visit_str(v)
692-
} else if let Some(TokenType::Tag(handle, suffix)) = tag {
690+
if let Some(TokenType::Tag(handle, suffix)) = tag {
693691
if handle == "!!" {
694692
match suffix.as_ref() {
695693
"bool" => match v.parse::<bool>() {
@@ -713,8 +711,10 @@ where
713711
} else {
714712
visitor.visit_str(v)
715713
}
716-
} else {
714+
} else if style == TScalarStyle::Plain {
717715
visit_untagged_str(visitor, v)
716+
} else {
717+
visitor.visit_str(v)
718718
}
719719
}
720720

0 commit comments

Comments
 (0)