aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-05-13 12:52:13 +0200
committerDaniel <kingdread@gmx.de>2020-05-13 12:52:13 +0200
commit331d6b1762d1d9431b210fc98a495d56ad7a1cd1 (patch)
tree24345d05808eaa0f034b5b33c3d335624b0111c6 /src/main.rs
parent279fed9f175a84799f37ffb3fbb22b64313f8c47 (diff)
downloadraidgrep-331d6b1762d1d9431b210fc98a495d56ad7a1cd1.tar.gz
raidgrep-331d6b1762d1d9431b210fc98a495d56ad7a1cd1.tar.bz2
raidgrep-331d6b1762d1d9431b210fc98a495d56ad7a1cd1.zip
clean up SearchField related code
With the addition of our own parser, we no longer need the FromStr implementation for SearchField. Furthermore, it is now only used in player::NameFilter, so the definition has been moved there. The import in the grammar was unused as well, so it has been removed.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/main.rs b/src/main.rs
index 40f434c..ee1c232 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -101,30 +101,6 @@ pub struct Opt {
expression: Vec<String>,
}
-/// A flag indicating which fields should be searched.
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub enum SearchField {
- /// Only search the account name.
- Account,
- /// Only search the character name.
- Character,
- /// Only search the guild name or tag.
- Guild,
-}
-
-impl FromStr for SearchField {
- type Err = &'static str;
-
- fn from_str(s: &str) -> Result<Self, Self::Err> {
- match s {
- "account" => Ok(SearchField::Account),
- "character" => Ok(SearchField::Character),
- "guild" => Ok(SearchField::Guild),
- _ => Err("Must be account or character"),
- }
- }
-}
-
/// A log that matches the search criteria.
#[derive(Debug, Clone)]
pub struct LogResult {