diff options
Diffstat (limited to 'src/libstd/str.rs')
| -rw-r--r-- | src/libstd/str.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/libstd/str.rs b/src/libstd/str.rs index 7a9d3396c1b..fe2e7d9c567 100644 --- a/src/libstd/str.rs +++ b/src/libstd/str.rs @@ -938,15 +938,13 @@ Escapes a single character. */ fn escape_char(c: char) -> str { alt c { - '"' { "\\\"" } - '\\' { "\\\\" } -// TODO: uncomment these when https://github.com/graydon/rust/issues/1170 is -// fixed. -// '\n' { "\\n" } -// '\t' { "\\t" } -// '\r' { "\\r" } - '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] } - v { from_char(c) } + '"' { "\\\"" } + '\\' { "\\\\" } + '\n' { "\\n" } + '\t' { "\\t" } + '\r' { "\\r" } + '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] } + v { from_char(c) } } } |
