about summary refs log tree commit diff
path: root/src/libregex/vm.rs
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-14 22:46:59 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-19 10:43:24 -0500
commitf2ef2cda526ba601cf5091f65cb12962a0ae0956 (patch)
tree020d5860f63056176f6749edcb999e9a1559ddfc /src/libregex/vm.rs
parentfd4a5d9ef12a87cad61f2fa5dd0a011df263a2d0 (diff)
downloadrust-f2ef2cda526ba601cf5091f65cb12962a0ae0956.tar.gz
rust-f2ef2cda526ba601cf5091f65cb12962a0ae0956.zip
libregex: use `#[deriving(Copy)]`
Diffstat (limited to 'src/libregex/vm.rs')
-rw-r--r--src/libregex/vm.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libregex/vm.rs b/src/libregex/vm.rs
index 15a678d2e74..990d5a159f6 100644
--- a/src/libregex/vm.rs
+++ b/src/libregex/vm.rs
@@ -50,6 +50,7 @@ use unicode::regex::PERLW;
 pub type CaptureLocs = Vec<Option<uint>>;
 
 /// Indicates the type of match to be performed by the VM.
+#[deriving(Copy)]
 pub enum MatchKind {
     /// Only checks if a match exists or not. Does not return location.
     Exists,
@@ -60,8 +61,6 @@ pub enum MatchKind {
     Submatches,
 }
 
-impl Copy for MatchKind {}
-
 /// Runs an NFA simulation on the compiled expression given on the search text
 /// `input`. The search begins at byte index `start` and ends at byte index
 /// `end`. (The range is specified here so that zero-width assertions will work
@@ -96,6 +95,7 @@ struct Nfa<'r, 't> {
 
 /// Indicates the next action to take after a single non-empty instruction
 /// is processed.
+#[deriving(Copy)]
 pub enum StepState {
     /// This is returned if and only if a Match instruction is reached and
     /// we only care about the existence of a match. It instructs the VM to
@@ -109,8 +109,6 @@ pub enum StepState {
     StepContinue,
 }
 
-impl Copy for StepState {}
-
 impl<'r, 't> Nfa<'r, 't> {
     fn run(&mut self) -> CaptureLocs {
         let ncaps = match self.which {