From fe1318ba4bed791193a0daeb3f468ff8790c0be4 Mon Sep 17 00:00:00 2001 From: Joe Date: Sun, 21 Dec 2025 16:34:14 -0800 Subject: [PATCH] better parsing error --- src/server.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server.rs b/src/server.rs index 8445d49..907b39d 100644 --- a/src/server.rs +++ b/src/server.rs @@ -16,7 +16,7 @@ use winnow::{ Parser, ascii::{newline, space0}, combinator::{alt, eof, fail}, - error::StrContext, + error::{StrContext, StrContextValue}, token::take_while, }; @@ -237,9 +237,9 @@ fn parse_command<'i>(input: &mut &'i str) -> winnow::Result> { "add", "remove", "help", - fail.context(StrContext::Expected( - "supported commands are `add`, `remove`, or `help`".into(), - )), + fail.context(StrContext::Expected(StrContextValue::Description( + "`add `, `remove `, or `help`", + ))), )), ) .map(|(_, a)| match a {