about summary refs log tree commit diff
path: root/src/libregex
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-22 05:30:30 +0000
committerbors <bors@rust-lang.org>2014-09-22 05:30:30 +0000
commitcbb07e81be99271f9e240a27dcf540686d8c0bfc (patch)
treea0a2ce0e5d9e65137f445201cbcd01324ca0d275 /src/libregex
parent4e5b62618cb5341139177c1ef62e2467affd041f (diff)
parent0169218047dc989acf9ea25e3122b9c659acb6b3 (diff)
downloadrust-cbb07e81be99271f9e240a27dcf540686d8c0bfc.tar.gz
rust-cbb07e81be99271f9e240a27dcf540686d8c0bfc.zip
auto merge of #17029 : alexcrichton/rust/vec-stable, r=aturon
The following methods, types, and names have become stable:

* Vec
* Vec::as_mut_slice
* Vec::as_slice
* Vec::capacity
* Vec::clear
* Vec::default
* Vec::grow
* Vec::insert
* Vec::len
* Vec::new
* Vec::pop
* Vec::push
* Vec::remove
* Vec::set_len
* Vec::shrink_to_fit
* Vec::truncate
* Vec::with_capacity
* vec::raw
* vec::raw::from_buf
* vec::raw::from_raw_parts

The following have become unstable:

* Vec::dedup        // naming
* Vec::from_fn      // naming and unboxed closures
* Vec::get_mut      // will be removed for IndexMut
* Vec::grow_fn      // unboxed closures and naming
* Vec::retain       // unboxed closures
* Vec::swap_remove  // uncertain naming
* Vec::from_elem    // uncertain semantics
* vec::unzip        // should be generic for all collections

The following have been deprecated

* Vec::append - call .extend()
* Vec::append_one - call .push()
* Vec::from_slice - call .to_vec()
* Vec::grow_set - call .grow() and then .push()
* Vec::into_vec - move the vector instead
* Vec::move_iter - renamed to iter_move()
* Vec::push_all - call .extend()
* Vec::to_vec - call .clone()
* Vec:from_raw_parts - moved to raw::from_raw_parts

This is a breaking change in terms of the signature of the `Vec::grow` function.
The argument used to be taken by reference, but it is now taken by value. Code
must update by removing a leading `&` sigil or by calling `.clone()` to create a
value.

[breaking-change]
Diffstat (limited to 'src/libregex')
-rw-r--r--src/libregex/compile.rs2
-rw-r--r--src/libregex/parse.rs10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libregex/compile.rs b/src/libregex/compile.rs
index c4b517c5259..91c3da00162 100644
--- a/src/libregex/compile.rs
+++ b/src/libregex/compile.rs
@@ -156,7 +156,7 @@ impl<'r> Compiler<'r> {
             Capture(cap, name, x) => {
                 let len = self.names.len();
                 if cap >= len {
-                    self.names.grow(10 + cap - len, &None)
+                    self.names.grow(10 + cap - len, None)
                 }
                 *self.names.get_mut(cap) = name;
 
diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs
index ad60829c088..7f4289b128a 100644
--- a/src/libregex/parse.rs
+++ b/src/libregex/parse.rs
@@ -986,9 +986,9 @@ fn combine_ranges(unordered: Vec<(char, char)>) -> Vec<(char, char)> {
 // (or any of their negated forms). Note that this does not handle negation.
 fn perl_unicode_class(which: char) -> Vec<(char, char)> {
     match which.to_lowercase() {
-        'd' => Vec::from_slice(PERLD),
-        's' => Vec::from_slice(PERLS),
-        'w' => Vec::from_slice(PERLW),
+        'd' => PERLD.to_vec(),
+        's' => PERLS.to_vec(),
+        'w' => PERLW.to_vec(),
         _ => unreachable!(),
     }
 }
@@ -997,7 +997,7 @@ fn perl_unicode_class(which: char) -> Vec<(char, char)> {
 // `Cat` expression will never be a direct child of another `Cat` expression.
 fn concat_flatten(x: Ast, y: Ast) -> Ast {
     match (x, y) {
-        (Cat(mut xs), Cat(ys)) => { xs.push_all_move(ys); Cat(xs) }
+        (Cat(mut xs), Cat(ys)) => { xs.extend(ys.into_iter()); Cat(xs) }
         (Cat(mut xs), ast) => { xs.push(ast); Cat(xs) }
         (ast, Cat(mut xs)) => { xs.insert(0, ast); Cat(xs) }
         (ast1, ast2) => Cat(vec!(ast1, ast2)),
@@ -1019,7 +1019,7 @@ fn is_valid_cap(c: char) -> bool {
 
 fn find_class(classes: NamedClasses, name: &str) -> Option<Vec<(char, char)>> {
     match classes.binary_search(|&(s, _)| s.cmp(&name)) {
-        slice::Found(i) => Some(Vec::from_slice(classes[i].val1())),
+        slice::Found(i) => Some(classes[i].val1().to_vec()),
         slice::NotFound(_) => None,
     }
 }