better parsing error

This commit is contained in:
Joe 2025-12-21 16:34:14 -08:00
parent 1f109edb35
commit fe1318ba4b

View file

@ -16,7 +16,7 @@ use winnow::{
Parser, Parser,
ascii::{newline, space0}, ascii::{newline, space0},
combinator::{alt, eof, fail}, combinator::{alt, eof, fail},
error::StrContext, error::{StrContext, StrContextValue},
token::take_while, token::take_while,
}; };
@ -237,9 +237,9 @@ fn parse_command<'i>(input: &mut &'i str) -> winnow::Result<FeedCommand<'i>> {
"add", "add",
"remove", "remove",
"help", "help",
fail.context(StrContext::Expected( fail.context(StrContext::Expected(StrContextValue::Description(
"supported commands are `add`, `remove`, or `help`".into(), "`add <feed url>`, `remove <feed url>`, or `help`",
)), ))),
)), )),
) )
.map(|(_, a)| match a { .map(|(_, a)| match a {