aboutsummaryrefslogtreecommitdiff
path: root/src/fexpr/grammar.lalrpop
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2021-11-12 14:08:35 +0100
committerDaniel <kingdread@gmx.de>2021-11-12 14:08:35 +0100
commit2e2bdac00092f8fcb96283da697a7a820a8c8978 (patch)
tree6a49f4f852c39a261d7210a002d6f39dc377a581 /src/fexpr/grammar.lalrpop
parent14d90bcbe6cef70d0ab99cb3285038fbd6385efa (diff)
downloadraidgrep-2e2bdac00092f8fcb96283da697a7a820a8c8978.tar.gz
raidgrep-2e2bdac00092f8fcb96283da697a7a820a8c8978.tar.bz2
raidgrep-2e2bdac00092f8fcb96283da697a7a820a8c8978.zip
Minor code smell fixes
Diffstat (limited to 'src/fexpr/grammar.lalrpop')
-rw-r--r--src/fexpr/grammar.lalrpop19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/fexpr/grammar.lalrpop b/src/fexpr/grammar.lalrpop
index 6333783..ce78396 100644
--- a/src/fexpr/grammar.lalrpop
+++ b/src/fexpr/grammar.lalrpop
@@ -102,7 +102,6 @@ Regex: Regex = {
.map_err(|error| ParseError::User {
error: FError {
location: l,
- data: s.to_string(),
kind: error.into(),
}
}),
@@ -112,7 +111,6 @@ Regex: Regex = {
.map_err(|error| ParseError::User {
error: FError {
location: l,
- data: s.to_string(),
kind: error.into(),
}
}),
@@ -122,8 +120,7 @@ FightOutcome: FightOutcome = {
<l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User {
error: FError {
location: l,
- data: w.into(),
- kind: FErrorKind::InvalidFightOutcome,
+ kind: FErrorKind::FightOutcome,
}
}),
}
@@ -132,8 +129,7 @@ Weekday: Weekday = {
<l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User {
error: FError {
location: l,
- data: w.into(),
- kind: FErrorKind::InvalidWeekday,
+ kind: FErrorKind::Weekday,
}
}),
}
@@ -142,16 +138,14 @@ Encounter: Encounter = {
<l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User {
error: FError {
location: l,
- data: w.into(),
- kind: FErrorKind::InvalidBoss,
+ kind: FErrorKind::Boss,
}
}),
<l:@L> <s:string> =>? s[1..s.len() -1].parse().map_err(|_| ParseError::User {
error: FError {
location: l,
- data: s.into(),
- kind: FErrorKind::InvalidBoss,
+ kind: FErrorKind::Boss,
}
}),
}
@@ -160,8 +154,7 @@ PlayerClass: PlayerClass = {
<l:@L> <w:word> =>? w.parse().map_err(|_| ParseError::User {
error: FError {
location: l,
- data: w.into(),
- kind: FErrorKind::InvalidClass,
+ kind: FErrorKind::Class,
}
}),
}
@@ -171,7 +164,6 @@ Date: DateTime<Utc> = {
.map_err(|error| ParseError::User {
error: FError {
location: l,
- data: d.into(),
kind: error.into(),
}
})
@@ -180,7 +172,6 @@ Date: DateTime<Utc> = {
.map_err(|error| ParseError::User {
error: FError {
location: l,
- data: d.into(),
kind: error.into(),
}
})