mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
libregex: use #[deriving(Copy)]
This commit is contained in:
@@ -77,14 +77,12 @@ pub enum Repeater {
|
||||
OneMore,
|
||||
}
|
||||
|
||||
#[deriving(Show, Clone)]
|
||||
#[deriving(Copy, Show, Clone)]
|
||||
pub enum Greed {
|
||||
Greedy,
|
||||
Ungreedy,
|
||||
}
|
||||
|
||||
impl Copy for Greed {}
|
||||
|
||||
impl Greed {
|
||||
pub fn is_greedy(&self) -> bool {
|
||||
match *self {
|
||||
|
||||
+1
-2
@@ -126,6 +126,7 @@ pub struct ExDynamic {
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[deriving(Copy)]
|
||||
pub struct ExNative {
|
||||
#[doc(hidden)]
|
||||
pub original: &'static str,
|
||||
@@ -135,8 +136,6 @@ pub struct ExNative {
|
||||
pub prog: fn(MatchKind, &str, uint, uint) -> Vec<Option<uint>>
|
||||
}
|
||||
|
||||
impl Copy for ExNative {}
|
||||
|
||||
impl Clone for ExNative {
|
||||
fn clone(&self) -> ExNative {
|
||||
*self
|
||||
|
||||
+2
-4
@@ -50,6 +50,7 @@
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user