Closed baoyachi closed 3 months ago
But use Located<&winnow::BStr>
is ok, it's surprised
use winnow::{BStr, Located, Parser, PResult};
use winnow::token::{any};
fn main() {}
fn char_token(input: &mut Located<&winnow::BStr>) -> PResult<char> {
any.try_map(char::try_from).parse_next(input)
}
Try
use winnow::{BStr, Parser, PResult};
use winnow::token::{any};
fn main() {
}
-fn char_token(input:&mut BStr) -> PResult<char>{
+fn char_token(input:&mut &BStr) -> PResult<char>{
any.try_map(char::try_from).parse_next(input)
}
Thx @epage .I overlooked the details.
Please complete the following tasks
rust version
rustc 1.78.0 (9b00956e5 2024-04-29)
winnow version
0.6.13
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run
Actual Behaviour
Expected Behaviour
how to use any combinator get char
Additional Context
No response