Rename `core::char::Char` to `CharExt` to match prelude guidelines.
Imports may need to be updated so this is a [breaking-change]
This commit is contained in:
parent
01417f245c
commit
19120209d8
|
@ -103,7 +103,7 @@ mod std {
|
|||
mod prelude {
|
||||
// from core.
|
||||
pub use core::borrow::IntoCow;
|
||||
pub use core::char::Char;
|
||||
pub use core::char::CharExt;
|
||||
pub use core::clone::Clone;
|
||||
pub use core::cmp::{PartialEq, Eq, PartialOrd, Ord};
|
||||
pub use core::cmp::Ordering::{Less, Equal, Greater};
|
||||
|
|
|
@ -55,7 +55,7 @@ use self::RecompositionState::*;
|
|||
use self::DecompositionType::*;
|
||||
|
||||
use core::borrow::{BorrowFrom, ToOwned};
|
||||
use core::char::Char;
|
||||
use core::char::CharExt;
|
||||
use core::clone::Clone;
|
||||
use core::iter::AdditiveIterator;
|
||||
use core::iter::{range, Iterator, IteratorExt};
|
||||
|
|
|
@ -112,7 +112,7 @@ pub fn from_digit(num: uint, radix: uint) -> Option<char> {
|
|||
|
||||
/// Basic `char` manipulations.
|
||||
#[stable]
|
||||
pub trait Char {
|
||||
pub trait CharExt {
|
||||
/// Checks if a `char` parses as a numeric digit in the given radix.
|
||||
///
|
||||
/// Compared to `is_numeric()`, this function only recognizes the characters
|
||||
|
|
|
@ -15,7 +15,7 @@ pub use self::SignificantDigits::*;
|
|||
pub use self::SignFormat::*;
|
||||
|
||||
use char;
|
||||
use char::Char;
|
||||
use char::CharExt;
|
||||
use fmt;
|
||||
use iter::{IteratorExt, range};
|
||||
use num::{cast, Float, ToPrimitive};
|
||||
|
|
|
@ -388,7 +388,7 @@ impl<'a> Formatter<'a> {
|
|||
prefix: &str,
|
||||
buf: &str)
|
||||
-> Result {
|
||||
use char::Char;
|
||||
use char::CharExt;
|
||||
use fmt::rt::{FlagAlternate, FlagSignPlus, FlagSignAwareZeroPad};
|
||||
|
||||
let mut width = buf.len();
|
||||
|
@ -504,7 +504,7 @@ impl<'a> Formatter<'a> {
|
|||
fn with_padding<F>(&mut self, padding: uint, default: rt::Alignment, f: F) -> Result where
|
||||
F: FnOnce(&mut Formatter) -> Result,
|
||||
{
|
||||
use char::Char;
|
||||
use char::CharExt;
|
||||
let align = match self.align {
|
||||
rt::AlignUnknown => default,
|
||||
_ => self.align
|
||||
|
@ -613,7 +613,7 @@ impl Show for str {
|
|||
|
||||
impl Show for char {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
use char::Char;
|
||||
use char::CharExt;
|
||||
|
||||
let mut utf8 = [0u8; 4];
|
||||
let amt = self.encode_utf8(&mut utf8).unwrap_or(0);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#![stable]
|
||||
#![allow(missing_docs)]
|
||||
|
||||
use char::Char;
|
||||
use char::CharExt;
|
||||
use clone::Clone;
|
||||
use cmp::{PartialEq, Eq};
|
||||
use cmp::{PartialOrd, Ord};
|
||||
|
|
|
@ -38,7 +38,7 @@ pub use mem::drop;
|
|||
|
||||
// Reexported types and traits
|
||||
|
||||
pub use char::Char;
|
||||
pub use char::CharExt;
|
||||
pub use clone::Clone;
|
||||
pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
|
||||
pub use iter::{Extend, IteratorExt};
|
||||
|
|
|
@ -50,7 +50,6 @@ use rustc::session::config;
|
|||
use std::rc::Rc;
|
||||
use std::u32;
|
||||
use std::str::Str as StrTrait; // Conflicts with Str variant
|
||||
use std::char::Char as CharTrait; // Conflicts with Char variant
|
||||
use std::path::Path as FsPath; // Conflicts with Path struct
|
||||
|
||||
use core::DocContext;
|
||||
|
|
|
@ -225,7 +225,7 @@ pub use self::FileMode::*;
|
|||
pub use self::FileAccess::*;
|
||||
pub use self::IoErrorKind::*;
|
||||
|
||||
use char::Char;
|
||||
use char::CharExt;
|
||||
use clone::Clone;
|
||||
use default::Default;
|
||||
use error::{FromError, Error};
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// Reexported types and traits
|
||||
|
||||
#[stable] #[doc(no_inline)] pub use boxed::Box;
|
||||
#[stable] #[doc(no_inline)] pub use char::{Char, UnicodeChar};
|
||||
#[stable] #[doc(no_inline)] pub use char::{CharExt, UnicodeChar};
|
||||
#[stable] #[doc(no_inline)] pub use clone::Clone;
|
||||
#[stable] #[doc(no_inline)] pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
|
||||
#[stable] #[doc(no_inline)] pub use iter::CloneIteratorExt;
|
||||
|
|
|
@ -58,7 +58,7 @@ mod u_str;
|
|||
/// however the converse is not always true due to the above range limits
|
||||
/// and, as such, should be performed via the `from_u32` function..
|
||||
pub mod char {
|
||||
pub use core::char::{MAX, from_u32, from_digit, Char};
|
||||
pub use core::char::{MAX, from_u32, from_digit, CharExt};
|
||||
|
||||
pub use normalize::{decompose_canonical, decompose_compatible, compose};
|
||||
|
||||
|
|
Loading…
Reference in New Issue