Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

Add re-export of nom's IResult #1

Open
jonhoo opened this issue Nov 3, 2017 · 2 comments
Open

Add re-export of nom's IResult #1

jonhoo opened this issue Nov 3, 2017 · 2 comments

Comments

@jonhoo
Copy link

jonhoo commented Nov 3, 2017

Given that IResult is returned by parse_response, it would be useful for imap-proto to re-export nom::IResult (as well as perhaps the various types included in its variants) so that users of this crate do not need to explicitly pull in nom.

@djc
Copy link
Owner

djc commented Nov 11, 2017

Yeah -- I experimented with exporting a type alias called ParserResult to abstract over the nom dependency a little bit, but that did not seem to work so well because the enum variants don't seem to be accessible through the alias. They really should be to make it ergonomic to consume the result, so I'll need to do a bit more experimentation.

@djc
Copy link
Owner

djc commented Dec 28, 2017

I opened a Rust internals thread about this topic: https://internals.rust-lang.org/t/pre-rfc-enum-variants-through-type-aliases/6433.

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

No branches or pull requests

2 participants