diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-10-31 16:20:41 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-11-21 13:18:08 -0800 |
| commit | aad246160451aacc2f7a707c028bdf44e77ad38d (patch) | |
| tree | 0caee1d89bc0703990a241775aae0bff49d84b01 /src/libsyntax | |
| parent | ca1820b1fce5aa803ccc757e79dd659f599d1516 (diff) | |
| download | rust-aad246160451aacc2f7a707c028bdf44e77ad38d.tar.gz rust-aad246160451aacc2f7a707c028bdf44e77ad38d.zip | |
core: Convert Char::escape_default, escape_unicode to iterators
[breaking-change]
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index e19e38e2977..4c759cfc4fd 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -193,7 +193,7 @@ impl<'a> StringReader<'a> { fn fatal_span_char(&self, from_pos: BytePos, to_pos: BytePos, m: &str, c: char) -> ! { let mut m = m.to_string(); m.push_str(": "); - char::escape_default(c, |c| m.push(c)); + for c in c.escape_default() { m.push(c) } self.fatal_span_(from_pos, to_pos, m.as_slice()); } @@ -202,7 +202,7 @@ impl<'a> StringReader<'a> { fn err_span_char(&self, from_pos: BytePos, to_pos: BytePos, m: &str, c: char) { let mut m = m.to_string(); m.push_str(": "); - char::escape_default(c, |c| m.push(c)); + for c in c.escape_default() { m.push(c) } self.err_span_(from_pos, to_pos, m.as_slice()); } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5652a9a9d3a..4ce0d74bd37 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -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()) } |
