diff options
| author | Lzu Tao <taolzu@gmail.com> | 2020-05-22 15:29:47 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2020-05-22 15:29:47 +0000 |
| commit | 2df69baa55fc762b43df9bbae2a867c3e3200a13 (patch) | |
| tree | baf126b3057b6f3df412d87bc73ba7cfde64a851 /src/libcore/str | |
| parent | a9ca1ec9280ca1e5020edd699917c3367a30a798 (diff) | |
| download | rust-2df69baa55fc762b43df9bbae2a867c3e3200a13.tar.gz rust-2df69baa55fc762b43df9bbae2a867c3e3200a13.zip | |
Stabilize str_strip feature
Diffstat (limited to 'src/libcore/str')
| -rw-r--r-- | src/libcore/str/mod.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index c517286d498..b514e0f6d9c 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -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) } @@ -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>, |
