]> git.lizzy.rs Git - rust.git/commitdiff
std: Stabilize the `str_matches` feature
authorAlex Crichton <alex@alexcrichton.com>
Thu, 11 Jun 2015 01:49:26 +0000 (18:49 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 17 Jun 2015 16:07:16 +0000 (09:07 -0700)
This commit stabilizes the `str::{matches, rmatches}` functions and iterators,
but renames the unstable feature for the `str::{matches,rmatches}_indices`
function to `str_match_indices` due to the comment present on the functions
about the iterator's return value.

src/libcollections/str.rs
src/libcore/str/mod.rs

index d41e062cac3d833aa2909800e1ae52efd73f2709..55265aac99f8ea25d6862685d767f5ca6eb4ee77 100644 (file)
@@ -1527,8 +1527,7 @@ pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a
     /// let v: Vec<&str> = "1abc2abc3".matches(char::is_numeric).collect();
     /// assert_eq!(v, ["1", "2", "3"]);
     /// ```
-    #[unstable(feature = "str_matches",
-               reason = "method got recently added")]
+    #[stable(feature = "str_matches", since = "1.2.0")]
     pub fn matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> Matches<'a, P> {
         core_str::StrExt::matches(self, pat)
     }
@@ -1560,8 +1559,7 @@ pub fn matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> Matches<'a, P> {
     /// let v: Vec<&str> = "1abc2abc3".rmatches(char::is_numeric).collect();
     /// assert_eq!(v, ["3", "2", "1"]);
     /// ```
-    #[unstable(feature = "str_matches",
-               reason = "method got recently added")]
+    #[stable(feature = "str_matches", since = "1.2.0")]
     pub fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P>
         where P::Searcher: ReverseSearcher<'a>
     {
@@ -1605,7 +1603,7 @@ pub fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P>
     /// let v: Vec<(usize, usize)> = "ababa".match_indices("aba").collect();
     /// assert_eq!(v, [(0, 3)]); // only the first `aba`
     /// ```
-    #[unstable(feature = "str_matches",
+    #[unstable(feature = "str_match_indices",
                reason = "might have its iterator type changed")]
     // NB: Right now MatchIndices yields `(usize, usize)`, but it would
     // be more consistent with `matches` and `char_indices` to return `(usize, &str)`
@@ -1649,7 +1647,7 @@ pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P
     /// let v: Vec<(usize, usize)> = "ababa".rmatch_indices("aba").collect();
     /// assert_eq!(v, [(2, 5)]); // only the last `aba`
     /// ```
-    #[unstable(feature = "str_matches",
+    #[unstable(feature = "str_match_indices",
                reason = "might have its iterator type changed")]
     // NB: Right now RMatchIndices yields `(usize, usize)`, but it would
     // be more consistent with `rmatches` and `char_indices` to return `(usize, &str)`
index 7092df7b4c2c4f4f2bb2da692ca1bc3bf935570a..5a621176c4a812b45976d9744964f2ea31eeab62 100644 (file)
@@ -738,7 +738,7 @@ fn next_back(&mut self) -> Option<(usize, usize)>
         #[doc="Created with the method `.rmatch_indices()`."]
         struct RMatchIndices;
     stability:
-        #[unstable(feature = "str_internals",
+        #[unstable(feature = "str_match_indices",
                    reason = "type may be removed or have its iterator impl changed")]
     internal:
         MatchIndicesInternal yielding ((usize, usize));
@@ -779,7 +779,7 @@ fn next_back(&mut self) -> Option<&'a str>
         #[doc="Created with the method `.rmatches()`."]
         struct RMatches;
     stability:
-        #[unstable(feature = "str_internals", reason = "type got recently added")]
+        #[stable(feature = "str_matches", since = "1.2.0")]
     internal:
         MatchesInternal yielding (&'a str);
     delegate double ended;