-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(innate): add multiple rule categories
- Loading branch information
Showing
4 changed files
with
105 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
use std::vec; | ||
|
||
#[derive(PartialOrd, Ord, std::cmp::Eq, PartialEq, Hash, Debug)] | ||
pub enum RuleID { | ||
/// no empty titles | ||
F25, | ||
H25, | ||
} | ||
|
||
impl RuleID { | ||
/// get rule id to string | ||
pub fn as_str(&self) -> &'static str { | ||
match self { | ||
RuleID::F25 => "F25", | ||
RuleID::H25 => "H25", | ||
} | ||
} | ||
/// get pairs for a rule | ||
pub fn pairs(&self) -> Vec<&'static str> { | ||
match self { | ||
RuleID::H25 => vec!["H25.1.NoTitleEl", "H25.1.EmptyTitle"], | ||
} | ||
} | ||
// /// get the value of the rule id with the pair | ||
// pub fn index(&self, i: usize) -> String { | ||
// let pair = self.pairs(); | ||
|
||
// if pair.len() <= i { | ||
// self.as_str().to_owned() + pair[i] | ||
// } else { | ||
// self.as_str().into() | ||
// } | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters