#[inline]
pub fn next_code_point<'a, I: Iterator<Item = &'a u8>>(bytes: &mut I) -> Option<u32> {
// Decode UTF-8
- let x = match bytes.next() {
- None => return None,
- Some(&next_byte) if next_byte < 128 => return Some(next_byte as u32),
- Some(&next_byte) => next_byte,
- };
+ let x = *bytes.next()?;
+ if x < 128 {
+ return Some(x as u32)
+ }
// Multibyte case follows
// Decode from a byte combination out of: [[[x y] z] w]
}
}
-#[unstable(feature = "fused", issue = "35602")]
+#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for Chars<'a> {}
impl<'a> Chars<'a> {
}
}
-#[unstable(feature = "fused", issue = "35602")]
+#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for CharIndices<'a> {}
impl<'a> CharIndices<'a> {
}
}
-#[unstable(feature = "fused", issue = "35602")]
+#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for Bytes<'a> {}
#[unstable(feature = "trusted_len", issue = "37572")]
}
}
- #[unstable(feature = "fused", issue = "35602")]
+ #[stable(feature = "fused", since = "1.26.0")]
impl<'a, P: Pattern<'a>> FusedIterator for $forward_iterator<'a, P> {}
- #[unstable(feature = "fused", issue = "35602")]
+ #[stable(feature = "fused", since = "1.26.0")]
impl<'a, P: Pattern<'a>> FusedIterator for $reverse_iterator<'a, P>
where P::Searcher: ReverseSearcher<'a> {}
}
}
-#[unstable(feature = "fused", issue = "35602")]
+#[stable(feature = "fused", since = "1.26.0")]
impl<'a> FusedIterator for Lines<'a> {}
/// Created with the method [`lines_any`].
}
}
-#[unstable(feature = "fused", issue = "35602")]
+#[stable(feature = "fused", since = "1.26.0")]
#[allow(deprecated)]
impl<'a> FusedIterator for LinesAny<'a> {}
}
}
- #[stable(feature = "str_checked_slicing", since = "1.20.0")]
+ #[unstable(feature = "inclusive_range",
+ reason = "recently added, follows RFC",
+ issue = "28237")]
impl SliceIndex<str> for ops::RangeInclusive<usize> {
type Output = str;
#[inline]
- #[stable(feature = "str_checked_slicing", since = "1.20.0")]
+ #[unstable(feature = "inclusive_range",
+ reason = "recently added, follows RFC",
+ issue = "28237")]
impl SliceIndex<str> for ops::RangeToInclusive<usize> {
type Output = str;
#[inline]