mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-23 18:29:50 -04:00
Escape the string for the Display trait for VAL.
This commit is contained in:
parent
a5fe59bb7c
commit
d13c79729c
@ -210,8 +210,7 @@ impl Display for Val {
|
||||
&Val::Empty => write!(f, "NULL"),
|
||||
&Val::Float(ref ff) => write!(f, "{}", ff),
|
||||
&Val::Int(ref i) => write!(f, "{}", i),
|
||||
// TODO(jwall): Escape quotes in the string.
|
||||
&Val::Str(ref s) => write!(f, "\"{}\"", s),
|
||||
&Val::Str(ref s) => write!(f, "\"{}\"", s.replace("\"", "\\\"")),
|
||||
&Val::List(ref def) => {
|
||||
write!(f, "[")?;
|
||||
for v in def.iter() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user