Add quoting for " and '

This commit is contained in:
Tom Parker 2017-03-12 16:02:47 +00:00 committed by Tom Parker
parent 61a36bfbf6
commit 312efa5d05

View file

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