aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-11-03 03:00:24 +0100
committerTeddy Wing2018-11-03 03:00:24 +0100
commit33d17c5557f4d3a932eda818e1ac4ca715a720d7 (patch)
treef554f7b9af521ba32b1162301cb891db07074643
parent226c48b851351fcb3755953be61e102baa57f4cf (diff)
downloaddome-key-map-33d17c5557f4d3a932eda818e1ac4ca715a720d7.tar.bz2
parser: Remove `map_kind()` parser
This was split into two new functions, `map_kind_map()` and `map_kind_cmd()`, in 7776832ec11ee7d4e62cfd2a6ad7735f323ab5bc. As such, this function is no longer used or needed. Update the tests to use the new parser functions.
-rw-r--r--src/parser.rs19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 230709d..027c309 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -221,17 +221,6 @@ where
string_cmp(s, |l, r| l.eq_ignore_ascii_case(&r))
}
-fn map_kind<I>() -> impl Parser<Input = I, Output = MapKind>
-where
- I: Stream<Item = char>,
- I::Error: ParseError<I::Item, I::Range, I::Position>,
-{
- or(
- string("map").map(|_| MapKind::Map),
- string("cmd").map(|_| MapKind::Command),
- )
-}
-
fn map_kind_map<I>() -> impl Parser<Input = I, Output = MapKind>
where
I: Stream<Item = char>,
@@ -703,17 +692,17 @@ mod tests {
use super::*;
#[test]
- fn map_kind_parses_kind_map() {
+ fn map_kind_map_parses_kind_map() {
let text = "map";
- let result = map_kind().parse(text).map(|t| t.0);
+ let result = map_kind_map().parse(text).map(|t| t.0);
assert_eq!(result, Ok(MapKind::Map));
}
#[test]
- fn map_kind_parses_kind_command() {
+ fn map_kind_cmd_parses_kind_command() {
let text = "cmd";
- let result = map_kind().parse(text).map(|t| t.0);
+ let result = map_kind_cmd().parse(text).map(|t| t.0);
assert_eq!(result, Ok(MapKind::Command));
}