Tracking Issue for substr_range and related methods (original) (raw)

Feature gate: #![feature(substr_range)]

This is a tracking issue for str::substr_range, slice::subslice_range, and slice::element_offset as described in this ACP.

These methods can be used for error handling and to extend str::lines, str::split, slice::split, and other related methods.

Public API

impl str { fn substr_range(&self, substr: &str) -> Option<Range>; }

impl [T] { fn subslice_range(&self, subslice: &[T]) -> Option<Range>; fn element_offset(&self, element: &T) -> Option; }

Steps / History

Unresolved Questions

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html