From 2c8473435a2c9540f61504e7acaa6609fb131ba5 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 6 Oct 2018 10:39:17 +0100 Subject: [PATCH] Implement Clone and Default traits on Expression and types it depends on --- src/function/mod.rs | 2 +- src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/function/mod.rs b/src/function/mod.rs index 07cc966..6168800 100644 --- a/src/function/mod.rs +++ b/src/function/mod.rs @@ -31,7 +31,7 @@ impl fmt::Display for ComparisonOperator { } } -#[derive(Debug)] +#[derive(Clone, Debug)] pub enum Function { FilePath(PathBuf), FileRegex(PathBuf, Regex), diff --git a/src/lib.rs b/src/lib.rs index eae423f..ed3a039 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -94,7 +94,7 @@ pub struct State { } // Compound conditions joined by 'or' -#[derive(Debug, PartialEq, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct Expression(Vec); impl Expression { @@ -125,7 +125,7 @@ impl fmt::Display for Expression { } // Conditions joined by 'and' -#[derive(Debug, PartialEq, Eq)] +#[derive(Clone, Debug, Default, PartialEq, Eq)] struct CompoundCondition(Vec); impl CompoundCondition { @@ -154,7 +154,7 @@ impl fmt::Display for CompoundCondition { } } -#[derive(Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] enum Condition { Function(Function), InvertedFunction(Function),