Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FromStr-esque parsing trait #1724

Open
JamieH01 opened this issue Jan 31, 2024 · 1 comment
Open

FromStr-esque parsing trait #1724

JamieH01 opened this issue Jan 31, 2024 · 1 comment

Comments

@JamieH01
Copy link

I think a simple FromStr-esque trait would be useful to have for organization and possibly some combinators. I use FromStr a lot since its very good for small composable types providing their parsers, and a nom-ified trait for this would be a nice addition.

pub trait Parsable<O>: Sized {
    type Err;
    fn parse(s: O) -> IResult<Self, O, Self::Err>; 
}
@JamieH01
Copy link
Author

JamieH01 commented Feb 1, 2024

went ahead and made a pr: #1726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant