]> git.lizzy.rs Git - rust.git/commitdiff
Rename UTF16Item[s] to Utf16Item[s]
authorPiotr Jawniak <sawyer47@gmail.com>
Sun, 25 May 2014 15:35:30 +0000 (17:35 +0200)
committerPiotr Jawniak <sawyer47@gmail.com>
Wed, 28 May 2014 09:31:21 +0000 (11:31 +0200)
According to Rust's style guide acronyms should be CamelCase.

[breaking-change]

src/libcore/str.rs
src/libstd/str.rs

index 6d5e259ba5a9343e627dfaee9b21049618e77ec5..8b8ddbe847c018ea4c10f65de4fc109cb6c859a2 100644 (file)
@@ -692,19 +692,19 @@ macro_rules! next ( ($ret:expr) => {
 /// An iterator that decodes UTF-16 encoded codepoints from a vector
 /// of `u16`s.
 #[deriving(Clone)]
-pub struct UTF16Items<'a> {
+pub struct Utf16Items<'a> {
     iter: slice::Items<'a, u16>
 }
 /// The possibilities for values decoded from a `u16` stream.
 #[deriving(Eq, TotalEq, Clone, Show)]
-pub enum UTF16Item {
+pub enum Utf16Item {
     /// A valid codepoint.
     ScalarValue(char),
     /// An invalid surrogate without its pair.
     LoneSurrogate(u16)
 }
 
-impl UTF16Item {
+impl Utf16Item {
     /// Convert `self` to a `char`, taking `LoneSurrogate`s to the
     /// replacement character (U+FFFD).
     #[inline]
@@ -716,8 +716,8 @@ pub fn to_char_lossy(&self) -> char {
     }
 }
 
-impl<'a> Iterator<UTF16Item> for UTF16Items<'a> {
-    fn next(&mut self) -> Option<UTF16Item> {
+impl<'a> Iterator<Utf16Item> for Utf16Items<'a> {
+    fn next(&mut self) -> Option<Utf16Item> {
         let u = match self.iter.next() {
             Some(u) => *u,
             None => return None
@@ -781,8 +781,8 @@ fn size_hint(&self) -> (uint, Option<uint>) {
 ///                 ScalarValue('i'), ScalarValue('c'),
 ///                 LoneSurrogate(0xD834)]);
 /// ```
-pub fn utf16_items<'a>(v: &'a [u16]) -> UTF16Items<'a> {
-    UTF16Items { iter : v.iter() }
+pub fn utf16_items<'a>(v: &'a [u16]) -> Utf16Items<'a> {
+    Utf16Items { iter : v.iter() }
 }
 
 /// Return a slice of `v` ending at (and not including) the first NUL
index 9e15612c72b405555be1a36ac36ebeb0604acafd..eb97f0f6a280808735aab22a1852a0b1566d70cc 100644 (file)
@@ -86,8 +86,8 @@ fn main() {
 pub use core::str::{from_utf8, CharEq, Chars, CharOffsets};
 pub use core::str::{Bytes, CharSplits};
 pub use core::str::{CharSplitsN, Words, AnyLines, MatchIndices, StrSplits};
-pub use core::str::{eq_slice, is_utf8, is_utf16, UTF16Items};
-pub use core::str::{UTF16Item, ScalarValue, LoneSurrogate, utf16_items};
+pub use core::str::{eq_slice, is_utf8, is_utf16, Utf16Items};
+pub use core::str::{Utf16Item, ScalarValue, LoneSurrogate, utf16_items};
 pub use core::str::{truncate_utf16_at_nul, utf8_char_width, CharRange};
 pub use core::str::{Str, StrSlice};