mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Implement Clone and Default traits on Expression and types it depends on
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ impl fmt::Display for ComparisonOperator {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum Function {
|
||||
FilePath(PathBuf),
|
||||
FileRegex(PathBuf, Regex),
|
||||
|
||||
+3
-3
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user