Closed baoyachi closed 8 months ago
Is there a reason you are using tag
, rather than
one_of
char
directly (as it implements Parser
)For this example, both one_of
and char
are suitable.
However, in certain scenarios, semantically,
one_of
tends to imply a multiple choice selection where only one option is chosen.
Using the char
type requires hardcoding, and it does not passing parameters into a tag.
Please complete the following tasks
rust version
rustc 1.74.0 (79e9716c9 2023-11-13)
winnow version
0.5.31
Minimal reproducible code
SliceLen
is not implemented forchar
= help: the following other types implement trait
SliceLen
: Located Stateful<I, S> Partial Caseless[T; LEN] &'a [T] &'a [T; LEN] &'a str and 3 others note: required by a bound inwinnow::token::tag
--> ~/.cargo/registry/src/winnow-0.5.30/src/token/mod.rs:142:8 | 138 | pub fn tag<T, I, Error: ParserError>(tag: T) -> impl Parser<I, ::Slice, Error> | --- required by a bound in this function ... 142 | T: SliceLen + Clone, | ^^^^^^^^ required by this bound intag