From f5c071ccfa51a995e6d18b843d706fe716e90ba1 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Sun, 5 Jun 2016 12:53:08 +0530 Subject: [PATCH] run rustfmt on librustc_unicode --- src/librustc_unicode/char.rs | 18 ++++++++++-------- src/librustc_unicode/lib.rs | 8 ++++---- src/librustc_unicode/u_str.rs | 4 +++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index 863cada5b88..77de51b32e2 100644 --- a/src/librustc_unicode/char.rs +++ b/src/librustc_unicode/char.rs @@ -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>(iter: I) -> DecodeUtf16> Iterator for DecodeUtf16 { +impl> Iterator for DecodeUtf16 { type Item = Result; fn next(&mut self) -> Option> { let u = match self.buf.take() { Some(buf) => buf, - None => match self.iter.next() { - Some(u) => u, - None => return None, - }, + None => { + match self.iter.next() { + Some(u) => u, + None => return None, + } + } }; if u < 0xD800 || 0xDFFF < u { diff --git a/src/librustc_unicode/lib.rs b/src/librustc_unicode/lib.rs index 2f7f724e6af..b03d7ee79e8 100644 --- a/src/librustc_unicode/lib.rs +++ b/src/librustc_unicode/lib.rs @@ -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 diff --git a/src/librustc_unicode/u_str.rs b/src/librustc_unicode/u_str.rs index 18734a66871..0bac44b837f 100644 --- a/src/librustc_unicode/u_str.rs +++ b/src/librustc_unicode/u_str.rs @@ -144,7 +144,9 @@ impl Utf16Encoder { } } -impl Iterator for Utf16Encoder where I: Iterator { +impl Iterator for Utf16Encoder + where I: Iterator +{ type Item = u16; #[inline]