]> git.lizzy.rs Git - rust.git/commitdiff
std: Remove two internal `str_internals` functions
authorAlex Crichton <alex@alexcrichton.com>
Thu, 11 Jun 2015 01:10:12 +0000 (18:10 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 17 Jun 2015 16:07:16 +0000 (09:07 -0700)
These were just exposed to be used elsewhere at some point, but neither is
currently being used so just make them private again.

src/libcore/str/mod.rs
src/libstd/sys/common/wtf8.rs

index 13c6ad367257de4b201e651cc861e2d6e12a66b1..7092df7b4c2c4f4f2bb2da692ca1bc3bf935570a 100644 (file)
@@ -227,9 +227,8 @@ pub fn next_code_point(bytes: &mut slice::Iter<u8>) -> Option<u32> {
 
 /// Reads the last code point out of a byte iterator (assuming a
 /// UTF-8-like encoding).
-#[unstable(feature = "str_internals")]
 #[inline]
-pub fn next_code_point_reverse(bytes: &mut slice::Iter<u8>) -> Option<u32> {
+fn next_code_point_reverse(bytes: &mut slice::Iter<u8>) -> Option<u32> {
     // Decode UTF-8
     let w = match bytes.next_back() {
         None => return None,
@@ -1873,8 +1872,7 @@ fn as_ref(&self) -> &[u8] {
 /// Pluck a code point out of a UTF-8-like byte slice and return the
 /// index of the next code point.
 #[inline]
-#[unstable(feature = "str_internals")]
-pub fn char_range_at_raw(bytes: &[u8], i: usize) -> (u32, usize) {
+fn char_range_at_raw(bytes: &[u8], i: usize) -> (u32, usize) {
     if bytes[i] < 128 {
         return (bytes[i] as u32, i + 1);
     }
index b2dc01e3ccb199a52c0af28ee8052f66f0fc70e8..428c8560d8847087c69143806f8404c6fdca385d 100644 (file)
@@ -480,31 +480,6 @@ pub fn ascii_byte_at(&self, position: usize) -> u8 {
         }
     }
 
-    /// Returns the code point at `position`.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `position` is not at a code point boundary,
-    /// or is beyond the end of the string.
-    #[inline]
-    pub fn code_point_at(&self, position: usize) -> CodePoint {
-        let (code_point, _) = self.code_point_range_at(position);
-        code_point
-    }
-
-    /// Returns the code point at `position`
-    /// and the position of the next code point.
-    ///
-    /// # Panics
-    ///
-    /// Panics if `position` is not at a code point boundary,
-    /// or is beyond the end of the string.
-    #[inline]
-    pub fn code_point_range_at(&self, position: usize) -> (CodePoint, usize) {
-        let (c, n) = char_range_at_raw(&self.bytes, position);
-        (CodePoint { value: c }, n)
-    }
-
     /// Returns an iterator for the string’s code points.
     #[inline]
     pub fn code_points(&self) -> Wtf8CodePoints {