1
Fork 0

fix: Fix serializing strings containing :

Fixes #8.
This commit is contained in:
Lucas Schwiderski 2023-03-03 17:51:54 +01:00
parent e94218d8f5
commit 81213f7927
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8
2 changed files with 5 additions and 1 deletions

View file

@ -6,6 +6,10 @@
== [Unreleased] == [Unreleased]
== Fixed
- fix serializing strings containing `:`
== [v0.2.4] - 2023-03-01 == [v0.2.4] - 2023-03-01
== Fixed == Fixed

View file

@ -123,7 +123,7 @@ impl<'a> serde::ser::Serializer for &'a mut Serializer {
self.ensure_top_level_struct()?; self.ensure_top_level_struct()?;
let needs_quotes = let needs_quotes =
v.is_empty() || v.contains([' ', '\n', '\r', '\t', '=', '\'', '"', '\\', '/']); v.is_empty() || v.contains([' ', '\n', '\r', '\t', '=', '\'', '"', '\\', ':']);
if needs_quotes { if needs_quotes {
self.output += "\""; self.output += "\"";