//! Operations on ASCII strings and characters
#![unstable = "unsure about placement and naming"]
+#![allow(deprecated)]
use core::kinds::Sized;
use fmt;
self.chr
}
+ /// Deprecated: use `as_byte` isntead.
#[deprecated = "use as_byte"]
pub fn to_byte(self) -> u8 {
self.as_byte()
self.chr as char
}
+ /// Deprecated: use `as_char` isntead.
+ #[deprecated = "use as_char"]
+ pub fn to_char(self) -> char {
+ self.as_char()
+ }
+
/// Convert to lowercase.
#[inline]
#[stable]
let repr = me.repr.as_slice();
match me.prefix {
Some(DiskPrefix) => {
- repr.as_bytes()[0] == path.as_bytes()[0].to_ascii().to_uppercase().to_byte()
+ repr.as_bytes()[0] == path.as_bytes()[0].to_ascii().to_uppercase().as_byte()
}
Some(VerbatimDiskPrefix) => {
- repr.as_bytes()[4] == path.as_bytes()[0].to_ascii().to_uppercase().to_byte()
+ repr.as_bytes()[4] == path.as_bytes()[0].to_ascii().to_uppercase().as_byte()
}
_ => false
}
match (self.prefix, other.prefix) {
(Some(DiskPrefix), Some(VerbatimDiskPrefix)) => {
self.is_absolute() &&
- s_repr.as_bytes()[0].to_ascii().eq_ignore_case(o_repr.as_bytes()[4].to_ascii())
+ s_repr.as_bytes()[0].to_ascii().to_lowercase() ==
+ o_repr.as_bytes()[4].to_ascii().to_lowercase()
}
(Some(VerbatimDiskPrefix), Some(DiskPrefix)) => {
other.is_absolute() &&
- s_repr.as_bytes()[4].to_ascii().eq_ignore_case(o_repr.as_bytes()[0].to_ascii())
+ s_repr.as_bytes()[4].to_ascii().to_lowercase() ==
+ o_repr.as_bytes()[0].to_ascii().to_lowercase()
}
(Some(VerbatimDiskPrefix), Some(VerbatimDiskPrefix)) => {
- s_repr.as_bytes()[4].to_ascii().eq_ignore_case(o_repr.as_bytes()[4].to_ascii())
+ s_repr.as_bytes()[4].to_ascii().to_lowercase() ==
+ o_repr.as_bytes()[4].to_ascii().to_lowercase()
}
(Some(UNCPrefix(_,_)), Some(VerbatimUNCPrefix(_,_))) => {
s_repr.slice(2, self.prefix_len()) == o_repr.slice(8, other.prefix_len())
let mut s = String::from_str(s.slice_to(len));
unsafe {
let v = s.as_mut_vec();
- v[0] = (*v)[0]
- .to_ascii()
- .to_uppercase()
- .to_byte();
+ v[0] = (*v)[0].to_ascii().to_uppercase().as_byte();
}
if is_abs {
// normalize C:/ to C:\
let mut s = String::from_str(s.slice_to(len));
unsafe {
let v = s.as_mut_vec();
- v[4] = (*v)[4].to_ascii().to_uppercase().to_byte();
+ v[4] = (*v)[4].to_ascii().to_uppercase().as_byte();
}
Some(s)
}
match prefix {
Some(DiskPrefix) => {
s.push(prefix_.as_bytes()[0].to_ascii()
- .to_uppercase().to_char());
+ .to_uppercase().as_char());
s.push(':');
}
Some(VerbatimDiskPrefix) => {
s.push_str(prefix_.slice_to(4));
s.push(prefix_.as_bytes()[4].to_ascii()
- .to_uppercase().to_char());
+ .to_uppercase().as_char());
s.push_str(prefix_.slice_from(5));
}
Some(UNCPrefix(a,b)) => {