Skip to content

Commit

Permalink
Stabilize str_strip feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed May 22, 2020
1 parent a9ca1ec commit 2df69ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/libcore/str/mod.rs
Expand Up @@ -4052,15 +4052,13 @@ impl str {
/// # Examples
///
/// ```
/// #![feature(str_strip)]
///
/// assert_eq!("foo:bar".strip_prefix("foo:"), Some("bar"));
/// assert_eq!("foo:bar".strip_prefix("bar"), None);
/// assert_eq!("foofoo".strip_prefix("foo"), Some("foo"));
/// ```
#[must_use = "this returns the remaining substring as a new slice, \
without modifying the original"]
#[unstable(feature = "str_strip", reason = "newly added", issue = "67302")]
#[stable(feature = "str_strip", since = "1.45.0")]
pub fn strip_prefix<'a, P: Pattern<'a>>(&'a self, prefix: P) -> Option<&'a str> {
prefix.strip_prefix_of(self)
}
Expand All @@ -4082,14 +4080,13 @@ impl str {
/// # Examples
///
/// ```
/// #![feature(str_strip)]
/// assert_eq!("bar:foo".strip_suffix(":foo"), Some("bar"));
/// assert_eq!("bar:foo".strip_suffix("bar"), None);
/// assert_eq!("foofoo".strip_suffix("foo"), Some("foo"));
/// ```
#[must_use = "this returns the remaining substring as a new slice, \
without modifying the original"]
#[unstable(feature = "str_strip", reason = "newly added", issue = "67302")]
#[stable(feature = "str_strip", since = "1.45.0")]
pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a str>
where
P: Pattern<'a>,
Expand Down
1 change: 0 additions & 1 deletion src/librustc_trait_selection/lib.rs
Expand Up @@ -16,7 +16,6 @@
#![feature(in_band_lifetimes)]
#![feature(crate_visibility_modifier)]
#![feature(or_patterns)]
#![feature(str_strip)]
#![feature(option_zip)]
#![recursion_limit = "512"] // For rustdoc

Expand Down
1 change: 0 additions & 1 deletion src/tools/clippy/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`.)
Expand Down

0 comments on commit 2df69ba

Please sign in to comment.