about summary refs log tree commit diff
path: root/src/libregex
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-09-24 23:41:09 +1200
committerNick Cameron <ncameron@mozilla.com>2014-10-07 15:49:53 +1300
commit59976942eacd26c0cc37247c3ac0c78b97edc6ea (patch)
tree81df79265eb8601f2965303b9626b80ee728208f /src/libregex
parentb5ba2f5517b1f90d07969ca3facdf5132e42436c (diff)
downloadrust-59976942eacd26c0cc37247c3ac0c78b97edc6ea.tar.gz
rust-59976942eacd26c0cc37247c3ac0c78b97edc6ea.zip
Use slice syntax instead of slice_to, etc.
Diffstat (limited to 'src/libregex')
-rw-r--r--src/libregex/compile.rs2
-rw-r--r--src/libregex/parse.rs4
-rw-r--r--src/libregex/test/tests.rs2
-rw-r--r--src/libregex/vm.rs2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/libregex/compile.rs b/src/libregex/compile.rs
index c3e195af6f9..a32dfcf5d2a 100644
--- a/src/libregex/compile.rs
+++ b/src/libregex/compile.rs
@@ -102,7 +102,7 @@ impl Program {
         // This is a bit hacky since we have to skip over the initial
         // 'Save' instruction.
         let mut pre = String::with_capacity(5);
-        for inst in c.insts.slice_from(1).iter() {
+        for inst in c.insts[1..].iter() {
             match *inst {
                 OneChar(c, FLAG_EMPTY) => pre.push(c),
                 _ => break
diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs
index 7f4289b128a..bf576432631 100644
--- a/src/libregex/parse.rs
+++ b/src/libregex/parse.rs
@@ -511,7 +511,7 @@ impl<'a> Parser<'a> {
         self.chari = closer;
         let greed = try!(self.get_next_greedy());
         let inner = String::from_chars(
-            self.chars.as_slice().slice(start + 1, closer));
+            self.chars[start+1..closer]);
 
         // Parse the min and max values from the regex.
         let (mut min, mut max): (uint, Option<uint>);
@@ -944,7 +944,7 @@ impl<'a> Parser<'a> {
     }
 
     fn slice(&self, start: uint, end: uint) -> String {
-        String::from_chars(self.chars.as_slice().slice(start, end))
+        String::from_chars(self.chars[start..end])
     }
 }
 
diff --git a/src/libregex/test/tests.rs b/src/libregex/test/tests.rs
index 48065992bb0..088425c0888 100644
--- a/src/libregex/test/tests.rs
+++ b/src/libregex/test/tests.rs
@@ -130,7 +130,7 @@ macro_rules! mat(
             // actual capture groups to match test set.
             let (sexpect, mut sgot) = (expected.as_slice(), got.as_slice());
             if sgot.len() > sexpect.len() {
-                sgot = sgot.slice(0, sexpect.len())
+                sgot = sgot[0..sexpect.len()]
             }
             if sexpect != sgot {
                 fail!("For RE '{}' against '{}', expected '{}' but got '{}'",
diff --git a/src/libregex/vm.rs b/src/libregex/vm.rs
index 085975580b7..0a4dca9125a 100644
--- a/src/libregex/vm.rs
+++ b/src/libregex/vm.rs
@@ -145,7 +145,7 @@ impl<'r, 't> Nfa<'r, 't> {
                 // out early.
                 if self.prog.prefix.len() > 0 && clist.size == 0 {
                     let needle = self.prog.prefix.as_slice().as_bytes();
-                    let haystack = self.input.as_bytes().slice_from(self.ic);
+                    let haystack = self.input.as_bytes()[self.ic..];
                     match find_prefix(needle, haystack) {
                         None => break,
                         Some(i) => {