Skip to content

Commit cd6fb59

Browse files
committed
auto merge of #14437 : Sawyer47/rust/utf16-items, r=alexcrichton
According to Rust's style guide acronyms should be CamelCase.
2 parents 9659a50 + 8c5a8e1 commit cd6fb59

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/libcore/str.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -692,19 +692,19 @@ pub fn is_utf16(v: &[u16]) -> bool {
692692
/// An iterator that decodes UTF-16 encoded codepoints from a vector
693693
/// of `u16`s.
694694
#[deriving(Clone)]
695-
pub struct UTF16Items<'a> {
695+
pub struct Utf16Items<'a> {
696696
iter: slice::Items<'a, u16>
697697
}
698698
/// The possibilities for values decoded from a `u16` stream.
699699
#[deriving(Eq, TotalEq, Clone, Show)]
700-
pub enum UTF16Item {
700+
pub enum Utf16Item {
701701
/// A valid codepoint.
702702
ScalarValue(char),
703703
/// An invalid surrogate without its pair.
704704
LoneSurrogate(u16)
705705
}
706706

707-
impl UTF16Item {
707+
impl Utf16Item {
708708
/// Convert `self` to a `char`, taking `LoneSurrogate`s to the
709709
/// replacement character (U+FFFD).
710710
#[inline]
@@ -716,8 +716,8 @@ impl UTF16Item {
716716
}
717717
}
718718

719-
impl<'a> Iterator<UTF16Item> for UTF16Items<'a> {
720-
fn next(&mut self) -> Option<UTF16Item> {
719+
impl<'a> Iterator<Utf16Item> for Utf16Items<'a> {
720+
fn next(&mut self) -> Option<Utf16Item> {
721721
let u = match self.iter.next() {
722722
Some(u) => *u,
723723
None => return None
@@ -781,8 +781,8 @@ impl<'a> Iterator<UTF16Item> for UTF16Items<'a> {
781781
/// ScalarValue('i'), ScalarValue('c'),
782782
/// LoneSurrogate(0xD834)]);
783783
/// ```
784-
pub fn utf16_items<'a>(v: &'a [u16]) -> UTF16Items<'a> {
785-
UTF16Items { iter : v.iter() }
784+
pub fn utf16_items<'a>(v: &'a [u16]) -> Utf16Items<'a> {
785+
Utf16Items { iter : v.iter() }
786786
}
787787

788788
/// Return a slice of `v` ending at (and not including) the first NUL

src/libstd/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ use vec::Vec;
8686
pub use core::str::{from_utf8, CharEq, Chars, CharOffsets};
8787
pub use core::str::{Bytes, CharSplits};
8888
pub use core::str::{CharSplitsN, Words, AnyLines, MatchIndices, StrSplits};
89-
pub use core::str::{eq_slice, is_utf8, is_utf16, UTF16Items};
90-
pub use core::str::{UTF16Item, ScalarValue, LoneSurrogate, utf16_items};
89+
pub use core::str::{eq_slice, is_utf8, is_utf16, Utf16Items};
90+
pub use core::str::{Utf16Item, ScalarValue, LoneSurrogate, utf16_items};
9191
pub use core::str::{truncate_utf16_at_nul, utf8_char_width, CharRange};
9292
pub use core::str::{Str, StrSlice};
9393

0 commit comments

Comments
 (0)