Switched rules to Regexes, added Regex wrapper for serde

This commit is contained in:
2020-03-29 03:10:19 +02:00
parent d13836e433
commit 6be0f7e8f6
2 changed files with 88 additions and 1 deletions

View File

@@ -9,6 +9,9 @@ use log::{error, info};
pub mod utils;
use utils::SettingsType;
pub mod regex_wrapper;
use regex_wrapper::Regex;
/// Current version of the ruleset. It will help determine if the ruleset is
/// outdated or from a more recent version of the software than the one being in
/// use.
@@ -121,7 +124,7 @@ pub struct Settings {
/// a regex to be matched while the second represents the change
/// to be made to the input data.
#[serde(default)]
rules: Vec<(String, String)>,
pub rules: Vec<(Regex, Regex)>,
}
/// Representation inside the crate of LangEvolves settings.