about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2014-10-13 10:54:18 -0700
committerBrian Anderson <banderson@mozilla.com>2014-11-21 13:17:09 -0800
commit95c3f618c08fad57d0b01ae8692f1d9a00c5bec6 (patch)
tree8abded04e1c7fe9973672124ed137c6a553e2d81 /src/libcore
parent4dd17245769082d07c3f98100e5a7cf922813ec9 (diff)
core: Deprecated remaining free functions in `char`
Prefer the methods.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/char.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/char.rs b/src/libcore/char.rs
index 90b5506d65d..ad836fca57e 100644
--- a/src/libcore/char.rs
+++ b/src/libcore/char.rs
@@ -98,6 +98,7 @@ pub fn from_u32(i: u32) -> Option<char> {
 /// This just wraps `to_digit()`.
 ///
 #[inline]
+#[deprecated = "use the Char::is_digit method"]
 pub fn is_digit_radix(c: char, radix: uint) -> bool {
     match to_digit(c, radix) {
         Some(_) => true,
@@ -120,6 +121,7 @@ pub fn is_digit_radix(c: char, radix: uint) -> bool {
 /// Panics if given a `radix` outside the range `[0..36]`.
 ///
 #[inline]
+#[deprecated = "use the Char::to_digit method"]
 pub fn to_digit(c: char, radix: uint) -> Option<uint> {
     if radix > 36 {
         panic!("to_digit: radix is too high (maximum 36)");
@@ -174,6 +176,7 @@ pub fn from_digit(num: uint, radix: uint) -> Option<char> {
 /// - chars in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`
 /// - chars above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`
 ///
+#[deprecated = "use the Char::escape_unicode method"]
 pub fn escape_unicode(c: char, f: |char|) {
     // avoid calling str::to_str_radix because we don't really need to allocate
     // here.
@@ -206,6 +209,7 @@ pub fn escape_unicode(c: char, f: |char|) {
 /// - Any other chars in the range [0x20,0x7e] are not escaped.
 /// - Any other chars are given hex Unicode escapes; see `escape_unicode`.
 ///
+#[deprecated = "use the Char::escape_default method"]
 pub fn escape_default(c: char, f: |char|) {
     match c {
         '\t' => { f('\\'); f('t'); }
@@ -221,6 +225,7 @@ pub fn escape_default(c: char, f: |char|) {
 
 /// Returns the amount of bytes this `char` would need if encoded in UTF-8
 #[inline]
+#[deprecated = "use the Char::len_utf8 method"]
 pub fn len_utf8_bytes(c: char) -> uint {
     let code = c as u32;
     match () {