diff options
author | Matti Niemenmaa <matti.niemenmaa+git@iki.fi> | 2018-10-01 11:58:57 +0300 |
---|---|---|
committer | Matti Niemenmaa <matti.niemenmaa+git@iki.fi> | 2018-10-01 11:58:57 +0300 |
commit | 2059589f5420bed3d490822fc9560db3c3a21515 (patch) | |
tree | 019d9a7a18b1512d099e8a8b704caad1b3c97b1f /src | |
parent | f998fbe360b4ea37f27793a55831e988415b4b6d (diff) | |
download | milf-rs-2059589f5420bed3d490822fc9560db3c3a21515.tar.gz milf-rs-2059589f5420bed3d490822fc9560db3c3a21515.zip |
Avoid panic on pretty string ending in single quote
Fixes #262.
Diffstat (limited to 'src')
-rw-r--r-- | src/ser.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -585,6 +585,10 @@ impl<'a> Serializer<'a> { } } } + if can_be_pretty && found_singles > 0 && value.ends_with('\'') { + // We cannot escape the ending quote so we must use """ + can_be_pretty = false; + } if !can_be_pretty { debug_assert!(ty != Type::OnelineTripple); return Repr::Std(ty); |