Skip to content

Commit 9691ce1

Browse files
committed
core: Resolve a FIXME in str module
1 parent 4601810 commit 9691ce1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/libcore/str.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,9 +1329,7 @@ fn escape_char(c: char) -> str {
13291329
'\n' { "\\n" }
13301330
'\t' { "\\t" }
13311331
'\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] }
1332+
'\x00' to '\x1f' { #fmt["\\x%02x", c as uint] }
13351333
v { from_char(c) }
13361334
}
13371335
}
@@ -2297,6 +2295,11 @@ mod tests {
22972295
assert(escape("abc\"def") == "abc\\\"def");
22982296
}
22992297

2298+
#[test]
2299+
fn test_escape_char() {
2300+
assert escape_char('\x1f') == "\\x1f";
2301+
}
2302+
23002303
#[test]
23012304
fn test_map() {
23022305
assert "" == map("", char::to_upper);

0 commit comments

Comments
 (0)