We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4601810 commit 9691ce1Copy full SHA for 9691ce1
src/libcore/str.rs
@@ -1329,9 +1329,7 @@ fn escape_char(c: char) -> str {
1329
'\n' { "\\n" }
1330
'\t' { "\\t" }
1331
'\r' { "\\r" }
1332
- // FIXME: uncomment this when extfmt is moved to core
1333
- // in a snapshot.
1334
- // '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
+ '\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
1335
v { from_char(c) }
1336
}
1337
@@ -2297,6 +2295,11 @@ mod tests {
2297
2295
assert(escape("abc\"def") == "abc\\\"def");
2298
2296
2299
+ #[test]
+ fn test_escape_char() {
2300
+ assert escape_char('\x1f') == "\\x1f";
2301
+ }
2302
+
2303
#[test]
2304
fn test_map() {
2305
assert "" == map("", char::to_upper);
0 commit comments