Lost trying to use winnow

⚓ Rust    📅 2025-12-14    👤 surdeus    👁️ 5      

surdeus

Warning

This post was published 33 days ago. The information described in this article may have changed.

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Lost trying to use winnow

Hello,

I'm trying to use winnow instead of manual parsing stuff... And gosh ! What a headache !

Ok so...

here is my initial naive code :


fn parse_range(input: &mut str) -> winnow::Result<Range> {
    let (start, end) = separated_pair(
        digit1.try_map(|d: &str| u16::from_str_radix(d, 10)),
        literal("-"),
        digit1.try_map(|d: &str| u16::from_str_radix(d, 10)),
    )
    .parse_next(input)?;

    todo!()
}
bulid output (click for more details)

I've tried several things, but It's asking so many straits... I'm a bit lost...

1 post - 1 participant

Read full topic

🏷️ Rust_feed