about summary refs log tree commit diff
path: root/src/libregex/parse.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-28 10:29:56 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-29 14:11:16 -0800
commitb26daf3a67a4e283a5e2c49227b60a2321434de0 (patch)
tree9528d05be2a4e20a4d7b76ad76b3e930c6a6b636 /src/libregex/parse.rs
parent3dcc409fac18a258ba2a8af4345d9566ec8eebad (diff)
downloadrust-b26daf3a67a4e283a5e2c49227b60a2321434de0.tar.gz
rust-b26daf3a67a4e283a5e2c49227b60a2321434de0.zip
std: Second pass stabilization for `string`
This commit performs a second pass over the `std::string` module, performing the
following actions:

* The name `std::string` is now stable.
* The `String::from_utf8` function is now stable after having been altered to
  return a new `FromUtf8Error` structure. The `FromUtf8Error` structure is now
  stable as well as its `into_bytes` and `utf8_error` methods.
* The `String::from_utf8_lossy` function is now stable.
* The `String::from_chars` method is now deprecated in favor of `.collect()`
* The `String::from_raw_parts` method is now stable
* The `String::from_str` function remains experimental
* The `String::from_raw_buf` function remains experimental
* The `String::from_raw_buf_len` function remains experimental
* The `String::from_utf8_unchecked` function is now stable
* The `String::from_char` function is now deprecated in favor of
  `repeat(c).take(n).collect()`
* The `String::grow` function is now deprecated in favor of
  `.extend(repeat(c).take(n)`
* The `String::capacity` method is now stable
* The `String::reserve` method is now stable
* The `String::reserve_exact` method is now stable
* The `String::shrink_to_fit` method is now stable
* The `String::pop` method is now stable
* The `String::as_mut_vec` method is now stable
* The `String::is_empty` method is now stable
* The `IntoString` trait is now deprecated (there are no implementors)
* The `String::truncate` method is now stable
* The `String::insert` method is now stable
* The `String::remove` method is now stable
* The `String::push` method is now stable
* The `String::push_str` method is now stable
* The `String::from_utf16` function is now stable after its error type has now
  become an opaque structure to carry more semantic information in the future.

A number of these changes are breaking changes, but the migrations should be
fairly straightforward on a case-by-case basis (outlined above where possible).

[breaking-change]
Diffstat (limited to 'src/libregex/parse.rs')
-rw-r--r--src/libregex/parse.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs
index 105687b89fd..86c02de76dc 100644
--- a/src/libregex/parse.rs
+++ b/src/libregex/parse.rs
@@ -519,8 +519,8 @@ impl<'a> Parser<'a> {
             };
         self.chari = closer;
         let greed = try!(self.get_next_greedy());
-        let inner = String::from_chars(
-            self.chars[start+1..closer]);
+        let inner = self.chars[start+1..closer].iter().cloned()
+                                               .collect::<String>();
 
         // Parse the min and max values from the regex.
         let (mut min, mut max): (uint, Option<uint>);
@@ -954,7 +954,7 @@ impl<'a> Parser<'a> {
     }
 
     fn slice(&self, start: uint, end: uint) -> String {
-        String::from_chars(self.chars[start..end])
+        self.chars[start..end].iter().cloned().collect()
     }
 }