Skip to content

Commit 033fb26

Browse files
committed
Remove deprecated stuff.
1 parent 1b47ee5 commit 033fb26

File tree

1 file changed

+4
-96
lines changed

1 file changed

+4
-96
lines changed

src/lib.rs

Lines changed: 4 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,13 @@ impl Ascii {
3535
self.chr
3636
}
3737

38-
/// Deprecated: use `as_byte` isntead.
39-
#[deprecated = "use as_byte"]
40-
pub fn to_byte(self) -> u8 {
41-
self.as_byte()
42-
}
43-
4438
/// Converts an ascii character into a `char`.
4539
#[inline]
4640
#[unstable = "recently renamed"]
4741
pub fn as_char(&self) -> char {
4842
self.chr as char
4943
}
5044

51-
/// Deprecated: use `as_char` isntead.
52-
#[deprecated = "use as_char"]
53-
pub fn to_char(self) -> char {
54-
self.as_char()
55-
}
56-
5745
/// Convert to lowercase.
5846
#[inline]
5947
#[stable]
@@ -68,13 +56,6 @@ impl Ascii {
6856
Ascii{chr: self.chr.to_ascii_uppercase()}
6957
}
7058

71-
/// Compares two ascii characters of equality, ignoring case.
72-
#[inline]
73-
#[deprecated = "normalize with to_lowercase"]
74-
pub fn eq_ignore_case(self, other: Ascii) -> bool {
75-
self.chr.eq_ignore_ascii_case(&other.chr)
76-
}
77-
7859
// the following methods are like ctype, and the implementation is inspired by musl
7960

8061
/// Check if the character is a letter (a-z, A-Z)
@@ -281,26 +262,6 @@ impl OwnedAsciiCast<[u8]> for Vec<u8> {
281262
pub trait AsciiStr for Sized? {
282263
/// Convert to a string.
283264
fn as_str_ascii<'a>(&'a self) -> &'a str;
284-
285-
/// Deprecated: use `to_lowercase`
286-
#[deprecated="renamed `to_lowercase`"]
287-
fn to_lower(&self) -> Vec<Ascii>;
288-
289-
/// Convert to vector representing a lower cased ascii string.
290-
#[deprecated = "use iterators instead"]
291-
fn to_lowercase(&self) -> Vec<Ascii>;
292-
293-
/// Deprecated: use `to_uppercase`
294-
#[deprecated="renamed `to_uppercase`"]
295-
fn to_upper(&self) -> Vec<Ascii>;
296-
297-
/// Convert to vector representing a upper cased ascii string.
298-
#[deprecated = "use iterators instead"]
299-
fn to_uppercase(&self) -> Vec<Ascii>;
300-
301-
/// Compares two Ascii strings ignoring case.
302-
#[deprecated = "use iterators instead"]
303-
fn eq_ignore_case(&self, other: &[Ascii]) -> bool;
304265
}
305266

306267
#[experimental = "may be replaced by generic conversion traits"]
@@ -309,31 +270,6 @@ impl AsciiStr for [Ascii] {
309270
fn as_str_ascii<'a>(&'a self) -> &'a str {
310271
unsafe { mem::transmute(self) }
311272
}
312-
313-
#[inline]
314-
fn to_lower(&self) -> Vec<Ascii> {
315-
self.to_lowercase()
316-
}
317-
318-
#[inline]
319-
fn to_lowercase(&self) -> Vec<Ascii> {
320-
self.iter().map(|a| a.to_lowercase()).collect()
321-
}
322-
323-
#[inline]
324-
fn to_upper(&self) -> Vec<Ascii> {
325-
self.to_uppercase()
326-
}
327-
328-
#[inline]
329-
fn to_uppercase(&self) -> Vec<Ascii> {
330-
self.iter().map(|a| a.to_uppercase()).collect()
331-
}
332-
333-
#[inline]
334-
fn eq_ignore_case(&self, other: &[Ascii]) -> bool {
335-
self.iter().zip(other.iter()).all(|(&a, &b)| a.eq_ignore_case(b))
336-
}
337273
}
338274

339275
impl IntoString for Vec<Ascii> {
@@ -383,20 +319,10 @@ mod tests {
383319

384320
#[test]
385321
fn test_ascii() {
386-
assert_eq!(65u8.to_ascii().to_byte(), 65u8);
387-
assert_eq!(65u8.to_ascii().to_char(), 'A');
388-
assert_eq!('A'.to_ascii().to_char(), 'A');
389-
assert_eq!('A'.to_ascii().to_byte(), 65u8);
390-
391-
assert_eq!('A'.to_ascii().to_lowercase().to_char(), 'a');
392-
assert_eq!('Z'.to_ascii().to_lowercase().to_char(), 'z');
393-
assert_eq!('a'.to_ascii().to_uppercase().to_char(), 'A');
394-
assert_eq!('z'.to_ascii().to_uppercase().to_char(), 'Z');
395-
396-
assert_eq!('@'.to_ascii().to_lowercase().to_char(), '@');
397-
assert_eq!('['.to_ascii().to_lowercase().to_char(), '[');
398-
assert_eq!('`'.to_ascii().to_uppercase().to_char(), '`');
399-
assert_eq!('{'.to_ascii().to_uppercase().to_char(), '{');
322+
assert_eq!(65u8.to_ascii().as_byte(), 65u8);
323+
assert_eq!(65u8.to_ascii().as_char(), 'A');
324+
assert_eq!('A'.to_ascii().as_char(), 'A');
325+
assert_eq!('A'.to_ascii().as_byte(), 65u8);
400326

401327
assert!('0'.to_ascii().is_digit());
402328
assert!('9'.to_ascii().is_digit());
@@ -417,24 +343,6 @@ mod tests {
417343
let v = vec![40u8, 32u8, 59u8];
418344
assert_eq!(v.as_slice().to_ascii(), b);
419345
assert_eq!("( ;".to_string().as_slice().to_ascii(), b);
420-
421-
assert_eq!("abCDef&?#".to_ascii().to_lowercase().into_string(), "abcdef&?#".to_string());
422-
assert_eq!("abCDef&?#".to_ascii().to_uppercase().into_string(), "ABCDEF&?#".to_string());
423-
424-
assert_eq!("".to_ascii().to_lowercase().into_string(), "".to_string());
425-
assert_eq!("YMCA".to_ascii().to_lowercase().into_string(), "ymca".to_string());
426-
let mixed = "abcDEFxyz:.;".to_ascii();
427-
assert_eq!(mixed.to_uppercase().into_string(), "ABCDEFXYZ:.;".to_string());
428-
}
429-
430-
#[test]
431-
fn test_ascii_vec_ng() {
432-
assert_eq!("abCDef&?#".to_ascii().to_lowercase().into_string(), "abcdef&?#".to_string());
433-
assert_eq!("abCDef&?#".to_ascii().to_uppercase().into_string(), "ABCDEF&?#".to_string());
434-
assert_eq!("".to_ascii().to_lowercase().into_string(), "".to_string());
435-
assert_eq!("YMCA".to_ascii().to_lowercase().into_string(), "ymca".to_string());
436-
let mixed = "abcDEFxyz:.;".to_ascii();
437-
assert_eq!(mixed.to_uppercase().into_string(), "ABCDEFXYZ:.;".to_string());
438346
}
439347

440348
#[test]

0 commit comments

Comments
 (0)