1
Fork 0

Remove unnecessary allocations flagged by lint

This commit is contained in:
Seo Sanghyeon 2013-05-24 01:09:11 +09:00
parent 363e672736
commit 8f80323f09
40 changed files with 161 additions and 161 deletions

View file

@ -47,18 +47,18 @@ fn escape_str(s: &str) -> ~str {
let mut escaped = ~"\"";
for str::each_char(s) |c| {
match c {
'"' => escaped += ~"\\\"",
'\\' => escaped += ~"\\\\",
'\x08' => escaped += ~"\\b",
'\x0c' => escaped += ~"\\f",
'\n' => escaped += ~"\\n",
'\r' => escaped += ~"\\r",
'\t' => escaped += ~"\\t",
'"' => escaped += "\\\"",
'\\' => escaped += "\\\\",
'\x08' => escaped += "\\b",
'\x0c' => escaped += "\\f",
'\n' => escaped += "\\n",
'\r' => escaped += "\\r",
'\t' => escaped += "\\t",
_ => escaped += str::from_char(c)
}
};
escaped += ~"\"";
escaped += "\"";
escaped
}