Add quoting for " and '

This commit is contained in:
Tom Parker 2017-03-12 16:02:47 +00:00 committed by Tom Parker
parent 84ffcafbc2
commit 21049c8d6a

View file

@ -263,7 +263,7 @@ fn need_quotes(string: &str) -> bool {
|| need_quotes_spaces(string)
|| string.contains(|character: char| {
match character {
':' | '{' | '}' | '[' | ']' | ',' | '&' | '*' | '#' | '?' | '|' | '-' | '<' | '>' | '=' | '!' | '%' | '@' | '`' | '\\' | '\0' ... '\x06' | '\t' | '\n' | '\r' | '\x0e' ... '\x1a' | '\x1c' ... '\x1f' => true,
':' | '{' | '}' | '[' | ']' | ',' | '&' | '*' | '#' | '?' | '|' | '-' | '<' | '>' | '=' | '!' | '%' | '@' | '`' | '\"' | '\'' | '\\' | '\0' ... '\x06' | '\t' | '\n' | '\r' | '\x0e' ... '\x1a' | '\x1c' ... '\x1f' => true,
_ => false,
}
})