Implement Clone and Default traits on Expression and types it depends on

This commit is contained in:
Oliver Hamlet
2018-10-06 10:39:17 +01:00
parent 77c58c965f
commit 2c8473435a
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ impl fmt::Display for ComparisonOperator {
}
}
#[derive(Debug)]
#[derive(Clone, Debug)]
pub enum Function {
FilePath(PathBuf),
FileRegex(PathBuf, Regex),
+3 -3
View File
@@ -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<CompoundCondition>);
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<Condition>);
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),