Remove all uses of pub impl
. rs=style
This commit is contained in:
parent
1e52eede31
commit
5fb254695b
181 changed files with 2890 additions and 2784 deletions
|
@ -21,22 +21,22 @@ use vec::{CopyableVector, ImmutableVector, OwnedVector};
|
|||
#[deriving(Clone, Eq)]
|
||||
pub struct Ascii { priv chr: u8 }
|
||||
|
||||
pub impl Ascii {
|
||||
impl Ascii {
|
||||
/// Converts a ascii character into a `u8`.
|
||||
#[inline(always)]
|
||||
fn to_byte(self) -> u8 {
|
||||
pub fn to_byte(self) -> u8 {
|
||||
self.chr
|
||||
}
|
||||
|
||||
/// Converts a ascii character into a `char`.
|
||||
#[inline(always)]
|
||||
fn to_char(self) -> char {
|
||||
pub fn to_char(self) -> char {
|
||||
self.chr as char
|
||||
}
|
||||
|
||||
/// Convert to lowercase.
|
||||
#[inline(always)]
|
||||
fn to_lower(self) -> Ascii {
|
||||
pub fn to_lower(self) -> Ascii {
|
||||
if self.chr >= 65 && self.chr <= 90 {
|
||||
Ascii{chr: self.chr | 0x20 }
|
||||
} else {
|
||||
|
@ -46,7 +46,7 @@ pub impl Ascii {
|
|||
|
||||
/// Convert to uppercase.
|
||||
#[inline(always)]
|
||||
fn to_upper(self) -> Ascii {
|
||||
pub fn to_upper(self) -> Ascii {
|
||||
if self.chr >= 97 && self.chr <= 122 {
|
||||
Ascii{chr: self.chr & !0x20 }
|
||||
} else {
|
||||
|
@ -54,9 +54,9 @@ pub impl Ascii {
|
|||
}
|
||||
}
|
||||
|
||||
// Compares two ascii characters of equality, ignoring case.
|
||||
/// Compares two ascii characters of equality, ignoring case.
|
||||
#[inline(always)]
|
||||
fn eq_ignore_case(self, other: Ascii) -> bool {
|
||||
pub fn eq_ignore_case(self, other: Ascii) -> bool {
|
||||
self.to_lower().chr == other.to_lower().chr
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue