Skip to content
Open
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
3 changes: 1 addition & 2 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5296,7 +5296,6 @@ impl<T> [T] {
/// # Examples
/// Basic usage:
/// ```
/// #![feature(substr_range)]
/// use core::range::Range;
///
/// let nums = &[0, 5, 10, 0, 0, 5];
Expand All @@ -5311,7 +5310,7 @@ impl<T> [T] {
/// assert_eq!(iter.next(), Some(Range { start: 5, end: 6 }));
/// ```
#[must_use]
#[unstable(feature = "substr_range", issue = "126769")]
#[stable(feature = "substr_range", since = "CURRENT_RUSTC_VERSION")]
pub fn subslice_range(&self, subslice: &[T]) -> Option<core::range::Range<usize>> {
if T::IS_ZST {
panic!("elements are zero-sized");
Expand Down
3 changes: 1 addition & 2 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3111,7 +3111,6 @@ impl str {
///
/// # Examples
/// ```
/// #![feature(substr_range)]
/// use core::range::Range;
///
/// let data = "a, b, b, a";
Expand All @@ -3123,7 +3122,7 @@ impl str {
/// assert_eq!(iter.next(), Some(Range { start: 9, end: 10 }));
/// ```
#[must_use]
#[unstable(feature = "substr_range", issue = "126769")]
#[stable(feature = "substr_range", since = "CURRENT_RUSTC_VERSION")]
pub fn substr_range(&self, substr: &str) -> Option<Range<usize>> {
self.as_bytes().subslice_range(substr.as_bytes())
}
Expand Down
Loading