about summary refs log tree commit diff
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
commit28c690e07ed02a7207f3d82ff8df4d2753b4b78d (patch)
treeb7e5470fd25952b5128f867b8d63f6ced9bf0e77
parente820a03d1c905d58b27d7ac6d85f450f9754ba79 (diff)
parent221c482142f84d5889edb8d17efab6470c81cf04 (diff)
downloadrust-28c690e07ed02a7207f3d82ff8df4d2753b4b78d.tar.gz
rust-28c690e07ed02a7207f3d82ff8df4d2753b4b78d.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
-rw-r--r--src/driver.rs1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/driver.rs b/src/driver.rs
index d3a7e24937f..3e1f423865b 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -1,6 +1,5 @@
 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
 #![feature(rustc_private)]
-#![feature(str_strip)]
 
 // FIXME: switch to something more ergonomic here, once available.
 // (Currently there is no way to opt into sysroot crates without `extern crate`.)