about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-29 02:33:11 +0200
committerGitHub <noreply@github.com>2020-05-29 02:33:11 +0200
commit3bcf6973b65ecd1b09ff5b00df0dd41f6d5938dc (patch)
treec5cc4b7f87f386b684551c27577a28368372b48c /library/std/src/sys/unix/stack_overflow.rs
parentb18c55b1794ec4e456e3d64abf91f353ca27787e (diff)
parent2df69baa55fc762b43df9bbae2a867c3e3200a13 (diff)
downloadrust-3bcf6973b65ecd1b09ff5b00df0dd41f6d5938dc.tar.gz
rust-3bcf6973b65ecd1b09ff5b00df0dd41f6d5938dc.zip
Rollup merge of #72466 - lzutao:stabilize_str-strip, r=dtolnay
Stabilize str_strip feature

This PR stabilizes these APIs:

```rust
impl str {
    /// Returns a string slice with the prefix removed.
    ///
    /// If the string starts with the pattern `prefix`, `Some` is returned with the substring where
    /// the prefix is removed. Unlike `trim_start_matches`, this method removes the prefix exactly
    /// once.
    pub fn strip_prefix<'a, P: Pattern<'a>>(&'a self, prefix: P) -> Option<&'a str>;

    /// Returns a string slice with the suffix removed.
    ///
    /// If the string ends with the pattern `suffix`, `Some` is returned with the substring where
    /// the suffix is removed. Unlike `trim_end_matches`, this method removes the suffix exactly
    /// once.
    pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>
    where
        P: Pattern<'a>,
        <P as Pattern<'a>>::Searcher: ReverseSearcher<'a>;
}
```

Closes  #67302
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions