A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rust-lang/rust/issues/142312 below:

Tracking Issue for `str::trim_prefix`, `str::trim_suffix`, `slice::trim_prefix` and `slice::trim_suffix` · Issue #142312 · rust-lang/rust · GitHub

Feature gate: #![feature(trim_prefix_suffix)]

This is a tracking issue for adding trim_prefix and trim_suffix methods to str that remove at most one occurrence of a specified prefix or suffix while always returning a string slice (rather than Option<&str>), enabling easy method chaining.1

Public API
impl str {
    pub fn trim_prefix<P>(&self, prefix: P) -> &str
    where
        P: Pattern;

    pub fn trim_suffix<P>(&self, suffix: P) -> &str
    where
        P: Pattern,
        for<'a> P::Searcher<'a>: ReverseSearcher<'a>;
}
Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

Unresolved Questions
  1. https://github.com/rust-lang/libs-team/issues/597

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

Scripter17Scripter17Scripter17Scripter17Scripter17


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4