run rustfmt on librustc_unicode
This commit is contained in:
parent
382ab92cee
commit
f5c071ccfa
@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
use core::char::CharExt as C;
|
use core::char::CharExt as C;
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use tables::{derived_property, property, general_category, conversions};
|
use tables::{conversions, derived_property, general_category, property};
|
||||||
|
|
||||||
// stable reexports
|
// stable reexports
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[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")]
|
#[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 reexports
|
||||||
#[unstable(feature = "unicode", issue = "27783")]
|
#[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")]
|
#[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>;
|
type Item = Result<char, DecodeUtf16Error>;
|
||||||
|
|
||||||
fn next(&mut self) -> Option<Result<char, DecodeUtf16Error>> {
|
fn next(&mut self) -> Option<Result<char, DecodeUtf16Error>> {
|
||||||
let u = match self.buf.take() {
|
let u = match self.buf.take() {
|
||||||
Some(buf) => buf,
|
Some(buf) => buf,
|
||||||
None => match self.iter.next() {
|
None => {
|
||||||
Some(u) => u,
|
match self.iter.next() {
|
||||||
None => return None,
|
Some(u) => u,
|
||||||
},
|
None => return None,
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if u < 0xD800 || 0xDFFF < u {
|
if u < 0xD800 || 0xDFFF < u {
|
||||||
|
@ -43,14 +43,14 @@ pub mod char;
|
|||||||
|
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
pub mod str {
|
pub mod str {
|
||||||
pub use u_str::{UnicodeStr, SplitWhitespace};
|
pub use u_str::{SplitWhitespace, UnicodeStr};
|
||||||
pub use u_str::{utf8_char_width, is_utf16};
|
pub use u_str::{is_utf16, utf8_char_width};
|
||||||
pub use u_str::{Utf16Encoder};
|
pub use u_str::Utf16Encoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For use in libcollections, not re-exported in libstd.
|
// For use in libcollections, not re-exported in libstd.
|
||||||
pub mod derived_property {
|
pub mod derived_property {
|
||||||
pub use tables::derived_property::{Cased, Case_Ignorable};
|
pub use tables::derived_property::{Case_Ignorable, Cased};
|
||||||
}
|
}
|
||||||
|
|
||||||
// For use in libsyntax
|
// For use in libsyntax
|
||||||
|
@ -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;
|
type Item = u16;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
Loading…
Reference in New Issue
Block a user