From 0169218047dc989acf9ea25e3122b9c659acb6b3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 17 Sep 2014 12:56:31 -0700 Subject: Fix fallout from Vec stabilization --- src/libregex/compile.rs | 2 +- src/libregex/parse.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libregex') 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> { 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, } } -- cgit 1.4.1-3-g733a5