Skip to content

Commit 476046d

Browse files
alexcrichtonSimonSapin
authored andcommitted
Remove a large amount of deprecated functionality
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
1 parent e13cb3d commit 476046d

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

src/libstd/ascii.rs

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ use string::{mod, String};
2525
use to_string::IntoStr;
2626
use vec::Vec;
2727

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-
3528
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
3629
#[deriving(Clone, PartialEq, PartialOrd, Ord, Eq, Hash)]
3730
pub struct Ascii { chr: u8 }
@@ -49,26 +42,12 @@ impl Ascii {
4942
self.chr as char
5043
}
5144

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-
5945
/// Convert to lowercase.
6046
#[inline]
6147
pub fn to_lowercase(self) -> Ascii {
6248
Ascii{chr: ASCII_LOWER_MAP[self.chr as uint]}
6349
}
6450

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-
7251
/// Convert to uppercase.
7352
#[inline]
7453
pub fn to_uppercase(self) -> Ascii {
@@ -83,13 +62,6 @@ impl Ascii {
8362

8463
// the following methods are like ctype, and the implementation is inspired by musl
8564

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-
9365
/// Check if the character is a letter (a-z, A-Z)
9466
#[inline]
9567
pub fn is_alphabetic(&self) -> bool {
@@ -102,13 +74,6 @@ impl Ascii {
10274
self.chr >= 0x30 && self.chr <= 0x39
10375
}
10476

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-
11277
/// Check if the character is a letter or number
11378
#[inline]
11479
pub fn is_alphanumeric(&self) -> bool {
@@ -139,26 +104,12 @@ impl Ascii {
139104
(self.chr - 0x20) < 0x5F
140105
}
141106

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-
149107
/// Checks if the character is lowercase
150108
#[inline]
151109
pub fn is_lowercase(&self) -> bool {
152110
(self.chr - b'a') < 26
153111
}
154112

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-
162113
/// Checks if the character is uppercase
163114
#[inline]
164115
pub fn is_uppercase(&self) -> bool {
@@ -581,7 +532,6 @@ mod tests {
581532
use prelude::*;
582533
use super::*;
583534
use char::from_u32;
584-
use vec::Vec;
585535
use str::StrSlice;
586536

587537
macro_rules! v2ascii (
@@ -590,7 +540,7 @@ mod tests {
590540
)
591541

592542
macro_rules! vec2ascii (
593-
($($e:expr),*) => (Vec::from_slice([$(Ascii{chr:$e}),*]));
543+
($($e:expr),*) => ([$(Ascii{chr:$e}),*].to_vec());
594544
)
595545

596546
#[test]

0 commit comments

Comments
 (0)