1
Fork 0

core: Convert Char::escape_default, escape_unicode to iterators

[breaking-change]
This commit is contained in:
Brian Anderson 2014-10-31 16:20:41 -07:00
parent ca1820b1fc
commit aad2461604
7 changed files with 110 additions and 43 deletions

View file

@ -2033,9 +2033,9 @@ fn lit_to_string(lit: &ast::Lit) -> String {
ast::LitBinary(ref data) => format!("{}", data),
ast::LitByte(b) => {
let mut res = String::from_str("b'");
(b as char).escape_default(|c| {
for c in (b as char).escape_default() {
res.push(c);
});
}
res.push('\'');
res
},