core: Add from_u32 to the Char trait
This is the only free function not part of the trait.
This commit is contained in:
parent
f530aa08df
commit
41fb8f77ee
@ -270,6 +270,9 @@ pub trait Char {
|
||||
/// Panics if given a radix > 36.
|
||||
fn from_digit(num: uint, radix: uint) -> Option<Self>;
|
||||
|
||||
/// Converts from `u32` to a `char`
|
||||
fn from_u32(i: u32) -> Option<char>;
|
||||
|
||||
/// Returns the hexadecimal Unicode escape of a character.
|
||||
///
|
||||
/// The rules are as follows:
|
||||
@ -319,6 +322,9 @@ impl Char for char {
|
||||
|
||||
fn from_digit(num: uint, radix: uint) -> Option<char> { from_digit(num, radix) }
|
||||
|
||||
#[inline]
|
||||
fn from_u32(i: u32) -> Option<char> { from_u32(i) }
|
||||
|
||||
fn escape_unicode(&self, f: |char|) { escape_unicode(*self, f) }
|
||||
|
||||
fn escape_default(&self, f: |char|) { escape_default(*self, f) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user