@@ -68,6 +68,7 @@ pub const MAX: char = '\U0010ffff';
68
68
69
69
/// Converts from `u32` to a `char`
70
70
#[ inline]
71
+ #[ unstable = "pending decisions about costructors for primitives" ]
71
72
pub fn from_u32 ( i : u32 ) -> Option < char > {
72
73
// catch out-of-bounds and surrogates
73
74
if ( i > MAX as u32 ) || ( i >= 0xD800 && i <= 0xDFFF ) {
@@ -146,6 +147,7 @@ pub fn to_digit(c: char, radix: uint) -> Option<uint> {
146
147
/// Panics if given an `radix` > 36.
147
148
///
148
149
#[ inline]
150
+ #[ unstable = "pending decisions about costructors for primitives" ]
149
151
pub fn from_digit ( num : uint , radix : uint ) -> Option < char > {
150
152
if radix > 36 {
151
153
panic ! ( "from_digit: radix is to high (maximum 36)" ) ;
@@ -286,9 +288,11 @@ pub trait Char {
286
288
/// # Panics
287
289
///
288
290
/// Panics if given a radix > 36.
291
+ #[ deprecated = "use the char::from_digit free function" ]
289
292
fn from_digit ( num : uint , radix : uint ) -> Option < Self > ;
290
293
291
294
/// Converts from `u32` to a `char`
295
+ #[ deprecated = "use the char::from_u32 free function" ]
292
296
fn from_u32 ( i : u32 ) -> Option < char > ;
293
297
294
298
/// Returns the hexadecimal Unicode escape of a character.
@@ -351,9 +355,11 @@ impl Char for char {
351
355
352
356
fn to_digit ( & self , radix : uint ) -> Option < uint > { to_digit ( * self , radix) }
353
357
358
+ #[ deprecated = "use the char::from_digit free function" ]
354
359
fn from_digit ( num : uint , radix : uint ) -> Option < char > { from_digit ( num, radix) }
355
360
356
361
#[ inline]
362
+ #[ deprecated = "use the char::from_u32 free function" ]
357
363
fn from_u32 ( i : u32 ) -> Option < char > { from_u32 ( i) }
358
364
359
365
fn escape_unicode ( & self , f: |char|) { escape_unicode ( * self , f) }
0 commit comments