Skip to content

Rename UTF16Item[s] to Utf16Item[s] #14437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/libcore/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -692,19 +692,19 @@ pub fn is_utf16(v: &[u16]) -> bool {
/// 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]
Expand All @@ -716,8 +716,8 @@ impl UTF16Item {
}
}

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
Expand Down Expand Up @@ -781,8 +781,8 @@ impl<'a> Iterator<UTF16Item> for UTF16Items<'a> {
/// 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
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ use vec::Vec;
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};

Expand Down