run rustfmt on librustc_unicode

This commit is contained in:
Srinivas Reddy Thatiparthy 2016-06-05 12:53:08 +05:30
parent 382ab92cee
commit f5c071ccfa
3 changed files with 17 additions and 13 deletions

View File

@ -30,13 +30,13 @@
use core::char::CharExt as C;
use core::fmt;
use tables::{derived_property, property, general_category, conversions};
use tables::{conversions, derived_property, general_category, property};
// stable reexports
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::char::{MAX, from_u32, from_u32_unchecked, from_digit};
pub use core::char::{MAX, from_digit, from_u32, from_u32_unchecked};
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::char::{EscapeUnicode, EscapeDefault, EncodeUtf8, EncodeUtf16};
pub use core::char::{EncodeUtf16, EncodeUtf8, EscapeDefault, EscapeUnicode};
// unstable reexports
#[unstable(feature = "unicode", issue = "27783")]
@ -808,16 +808,18 @@ pub fn decode_utf16<I: IntoIterator<Item = u16>>(iter: I) -> DecodeUtf16<I::Into
}
#[stable(feature = "decode_utf16", since = "1.9.0")]
impl<I: Iterator<Item=u16>> Iterator for DecodeUtf16<I> {
impl<I: Iterator<Item = u16>> Iterator for DecodeUtf16<I> {
type Item = Result<char, DecodeUtf16Error>;
fn next(&mut self) -> Option<Result<char, DecodeUtf16Error>> {
let u = match self.buf.take() {
Some(buf) => buf,
None => match self.iter.next() {
None => {
match self.iter.next() {
Some(u) => u,
None => return None,
},
}
}
};
if u < 0xD800 || 0xDFFF < u {

View File

@ -43,14 +43,14 @@ pub mod char;
#[allow(deprecated)]
pub mod str {
pub use u_str::{UnicodeStr, SplitWhitespace};
pub use u_str::{utf8_char_width, is_utf16};
pub use u_str::{Utf16Encoder};
pub use u_str::{SplitWhitespace, UnicodeStr};
pub use u_str::{is_utf16, utf8_char_width};
pub use u_str::Utf16Encoder;
}
// For use in libcollections, not re-exported in libstd.
pub mod derived_property {
pub use tables::derived_property::{Cased, Case_Ignorable};
pub use tables::derived_property::{Case_Ignorable, Cased};
}
// For use in libsyntax

View File

@ -144,7 +144,9 @@ impl<I> Utf16Encoder<I> {
}
}
impl<I> Iterator for Utf16Encoder<I> where I: Iterator<Item=char> {
impl<I> Iterator for Utf16Encoder<I>
where I: Iterator<Item = char>
{
type Item = u16;
#[inline]