#![stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::ascii::{escape_default, EscapeDefault};
#[stable(feature = "rust1", since = "1.0.0")]
#[deprecated(since = "1.26.0", note = "use inherent methods instead")]
pub trait AsciiExt {
#[stable(feature = "rust1", since = "1.0.0")]
type Owned;
#[stable(feature = "rust1", since = "1.0.0")]
fn is_ascii(&self) -> bool;
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
fn to_ascii_uppercase(&self) -> Self::Owned;
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
fn to_ascii_lowercase(&self) -> Self::Owned;
#[stable(feature = "rust1", since = "1.0.0")]
fn eq_ignore_ascii_case(&self, other: &Self) -> bool;
#[stable(feature = "ascii", since = "1.9.0")]
fn make_ascii_uppercase(&mut self);
#[stable(feature = "ascii", since = "1.9.0")]
fn make_ascii_lowercase(&mut self);
}
macro_rules! delegating_ascii_methods {
() => {
#[inline]
fn is_ascii(&self) -> bool {
self.is_ascii()
}
#[inline]
fn to_ascii_uppercase(&self) -> Self::Owned {
self.to_ascii_uppercase()
}
#[inline]
fn to_ascii_lowercase(&self) -> Self::Owned {
self.to_ascii_lowercase()
}
#[inline]
fn eq_ignore_ascii_case(&self, o: &Self) -> bool {
self.eq_ignore_ascii_case(o)
}
#[inline]
fn make_ascii_uppercase(&mut self) {
self.make_ascii_uppercase();
}
#[inline]
fn make_ascii_lowercase(&mut self) {
self.make_ascii_lowercase();
}
};
}
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
impl AsciiExt for u8 {
type Owned = u8;
delegating_ascii_methods!();
}
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
impl AsciiExt for char {
type Owned = char;
delegating_ascii_methods!();
}
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
impl AsciiExt for [u8] {
type Owned = Vec<u8>;
delegating_ascii_methods!();
}
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
impl AsciiExt for str {
type Owned = String;
delegating_ascii_methods!();
}