From 33d17c5557f4d3a932eda818e1ac4ca715a720d7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 3 Nov 2018 03:00:24 +0100 Subject: 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. --- src/parser.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src') 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() -> impl Parser -where - I: Stream, - I::Error: ParseError, -{ - or( - string("map").map(|_| MapKind::Map), - string("cmd").map(|_| MapKind::Command), - ) -} - fn map_kind_map() -> impl Parser where I: Stream, @@ -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)); } -- cgit v1.2.3