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

@@ -2756,7 +2756,9 @@ impl<'a> State<'a> {
}
ast::LitChar(ch) => {
let mut res = String::from_str("'");
ch.escape_default(|c| res.push(c));
for c in ch.escape_default() {
res.push(c);
}
res.push('\'');
word(&mut self.s, res.as_slice())
}