@@ -25,13 +25,6 @@ use string::{mod, String};
25
25
use to_string:: IntoStr ;
26
26
use vec:: Vec ;
27
27
28
- #[ deprecated="this trait has been renamed to `AsciiExt`" ]
29
- pub use self :: AsciiExt as StrAsciiExt ;
30
-
31
- #[ deprecated="this trait has been renamed to `OwnedAsciiExt`" ]
32
- pub use self :: OwnedAsciiExt as OwnedStrAsciiExt ;
33
-
34
-
35
28
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
36
29
#[ deriving( Clone , PartialEq , PartialOrd , Ord , Eq , Hash ) ]
37
30
pub struct Ascii { chr : u8 }
@@ -49,26 +42,12 @@ impl Ascii {
49
42
self . chr as char
50
43
}
51
44
52
- #[ inline]
53
- #[ allow( missing_doc) ]
54
- #[ deprecated="renamed to `to_lowercase`" ]
55
- pub fn to_lower ( self ) -> Ascii {
56
- self . to_lowercase ( )
57
- }
58
-
59
45
/// Convert to lowercase.
60
46
#[ inline]
61
47
pub fn to_lowercase ( self ) -> Ascii {
62
48
Ascii { chr : ASCII_LOWER_MAP [ self . chr as uint ] }
63
49
}
64
50
65
- /// Deprecated: use `to_uppercase`
66
- #[ inline]
67
- #[ deprecated="renamed to `to_uppercase`" ]
68
- pub fn to_upper ( self ) -> Ascii {
69
- self . to_uppercase ( )
70
- }
71
-
72
51
/// Convert to uppercase.
73
52
#[ inline]
74
53
pub fn to_uppercase ( self ) -> Ascii {
@@ -83,13 +62,6 @@ impl Ascii {
83
62
84
63
// the following methods are like ctype, and the implementation is inspired by musl
85
64
86
- #[ inline]
87
- #[ allow( missing_doc) ]
88
- #[ deprecated="renamed to `is_alphabetic`" ]
89
- pub fn is_alpha ( & self ) -> bool {
90
- self . is_alphabetic ( )
91
- }
92
-
93
65
/// Check if the character is a letter (a-z, A-Z)
94
66
#[ inline]
95
67
pub fn is_alphabetic ( & self ) -> bool {
@@ -102,13 +74,6 @@ impl Ascii {
102
74
self . chr >= 0x30 && self . chr <= 0x39
103
75
}
104
76
105
- #[ inline]
106
- #[ allow( missing_doc) ]
107
- #[ deprecated="renamed to `is_alphanumeric`" ]
108
- pub fn is_alnum ( & self ) -> bool {
109
- self . is_alphanumeric ( )
110
- }
111
-
112
77
/// Check if the character is a letter or number
113
78
#[ inline]
114
79
pub fn is_alphanumeric ( & self ) -> bool {
@@ -139,26 +104,12 @@ impl Ascii {
139
104
( self . chr - 0x20 ) < 0x5F
140
105
}
141
106
142
- /// Deprecated: use `to_lowercase`
143
- #[ inline]
144
- #[ deprecated="renamed to `is_lowercase`" ]
145
- pub fn is_lower ( & self ) -> bool {
146
- self . is_lowercase ( )
147
- }
148
-
149
107
/// Checks if the character is lowercase
150
108
#[ inline]
151
109
pub fn is_lowercase ( & self ) -> bool {
152
110
( self . chr - b'a' ) < 26
153
111
}
154
112
155
- #[ inline]
156
- #[ allow( missing_doc) ]
157
- #[ deprecated="renamed to `is_uppercase`" ]
158
- pub fn is_upper ( & self ) -> bool {
159
- self . is_uppercase ( )
160
- }
161
-
162
113
/// Checks if the character is uppercase
163
114
#[ inline]
164
115
pub fn is_uppercase ( & self ) -> bool {
@@ -581,7 +532,6 @@ mod tests {
581
532
use prelude:: * ;
582
533
use super :: * ;
583
534
use char:: from_u32;
584
- use vec:: Vec ;
585
535
use str:: StrSlice ;
586
536
587
537
macro_rules! v2ascii (
@@ -590,7 +540,7 @@ mod tests {
590
540
)
591
541
592
542
macro_rules! vec2ascii (
593
- ( $( $e: expr) ,* ) => ( Vec :: from_slice ( [ $( Ascii { chr: $e} ) ,* ] ) ) ;
543
+ ( $( $e: expr) ,* ) => ( [ $( Ascii { chr: $e} ) ,* ] . to_vec ( ) ) ;
594
544
)
595
545
596
546
#[ test]
0 commit comments