diff options
Diffstat (limited to 'src/libstd/char.rs')
| -rw-r--r-- | src/libstd/char.rs | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/src/libstd/char.rs b/src/libstd/char.rs index 6530755cb1d..c5a4dd1631d 100644 --- a/src/libstd/char.rs +++ b/src/libstd/char.rs @@ -241,7 +241,7 @@ static N_COUNT: uint = (V_COUNT * T_COUNT); static S_COUNT: uint = (L_COUNT * N_COUNT); // Decompose a precomposed Hangul syllable -fn decompose_hangul(s: char, f: &fn(char)) { +fn decompose_hangul(s: char, f: |char|) { let si = s as uint - S_BASE; let li = si / N_COUNT; @@ -259,7 +259,7 @@ fn decompose_hangul(s: char, f: &fn(char)) { } /// Returns the canonical decompostion of a character -pub fn decompose_canonical(c: char, f: &fn(char)) { +pub fn decompose_canonical(c: char, f: |char|) { if (c as uint) < S_BASE || (c as uint) >= (S_BASE + S_COUNT) { decompose::canonical(c, f); } else { @@ -268,7 +268,7 @@ pub fn decompose_canonical(c: char, f: &fn(char)) { } /// Returns the compatibility decompostion of a character -pub fn decompose_compatible(c: char, f: &fn(char)) { +pub fn decompose_compatible(c: char, f: |char|) { if (c as uint) < S_BASE || (c as uint) >= (S_BASE + S_COUNT) { decompose::compatibility(c, f); } else { @@ -285,7 +285,7 @@ pub fn decompose_compatible(c: char, f: &fn(char)) { /// - chars in [0x100,0xffff] get 4-digit escapes: `\\uNNNN` /// - chars above 0x10000 get 8-digit escapes: `\\UNNNNNNNN` /// -pub fn escape_unicode(c: char, f: &fn(char)) { +pub fn escape_unicode(c: char, f: |char|) { // avoid calling str::to_str_radix because we don't really need to allocate // here. f('\\'); @@ -316,7 +316,7 @@ pub fn escape_unicode(c: char, f: &fn(char)) { /// - Any other chars in the range [0x20,0x7e] are not escaped. /// - Any other chars are given hex unicode escapes; see `escape_unicode`. /// -pub fn escape_default(c: char, f: &fn(char)) { +pub fn escape_default(c: char, f: |char|) { match c { '\t' => { f('\\'); f('t'); } '\r' => { f('\\'); f('r'); } @@ -367,8 +367,8 @@ pub trait Char { fn is_digit_radix(&self, radix: uint) -> bool; fn to_digit(&self, radix: uint) -> Option<uint>; fn from_digit(num: uint, radix: uint) -> Option<char>; - fn escape_unicode(&self, f: &fn(char)); - fn escape_default(&self, f: &fn(char)); + fn escape_unicode(&self, f: |char|); + fn escape_default(&self, f: |char|); fn len_utf8_bytes(&self) -> uint; /// Encodes this character as utf-8 into the provided byte-buffer. The @@ -403,9 +403,9 @@ impl Char for char { fn from_digit(num: uint, radix: uint) -> Option<char> { from_digit(num, radix) } - fn escape_unicode(&self, f: &fn(char)) { escape_unicode(*self, f) } + fn escape_unicode(&self, f: |char|) { escape_unicode(*self, f) } - fn escape_default(&self, f: &fn(char)) { escape_default(*self, f) } + fn escape_default(&self, f: |char|) { escape_default(*self, f) } fn len_utf8_bytes(&self) -> uint { len_utf8_bytes(*self) } | 
