Skip to content

Commit

Permalink
chg: PartialEq impl for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
qjerome committed Jul 26, 2024
1 parent d013d2e commit fc7b15d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gene/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use thiserror::Error;

use crate::rules::matcher::{MatchParser, Rule};

#[derive(Error, Debug, Clone)]
#[derive(Error, Debug, Clone, PartialEq)]
pub enum PathError {
#[error("{0}")]
Parse(#[from] Box<pest::error::Error<Rule>>),
Expand Down
2 changes: 1 addition & 1 deletion gene/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub struct CompiledRule {
pub(crate) actions: HashSet<String>,
}

#[derive(Debug, Error)]
#[derive(Debug, Error, PartialEq)]
pub enum Error {
#[error("rule={0} {1}")]
Wrap(String, Box<Error>),
Expand Down
6 changes: 3 additions & 3 deletions gene/src/rules/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ lazy_static::lazy_static! {
};
}

#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub(crate) enum Op {
And,
Or,
}

#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub(crate) enum Expr {
Variable(String),
BinOp {
Expand All @@ -47,7 +47,7 @@ impl Default for Expr {
}
}

#[derive(Error, Debug)]
#[derive(Error, Debug, PartialEq)]
pub enum Error {
#[error("unknown operand {0}")]
UnknowOperand(String),
Expand Down
2 changes: 1 addition & 1 deletion gene/src/rules/matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl MatchValue {
}
}

#[derive(Error, Debug)]
#[derive(Error, Debug, PartialEq)]
pub enum Error {
#[error("field={0} not found")]
FieldNotFound(String),
Expand Down
2 changes: 1 addition & 1 deletion gene/src/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{

use thiserror::Error;

#[derive(Debug, Error)]
#[derive(Debug, Error, PartialEq)]
pub enum NumberError {
#[error("")]
InvalidConvertion,
Expand Down

0 comments on commit fc7b15d

Please sign in to comment.