-
Notifications
You must be signed in to change notification settings - Fork 5
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
Convert Eithers into Results. #12
Conversation
Right((v, _)) => Right(v) | ||
} | ||
pub fn execParser_<a: 'static>(parser: P<a>, input: InputStream, pos: Position) -> Result<a, ParseError> { | ||
execParser(parser, input, pos, builtinTypeNames(), newNameSupply()).map(|(v, _)| v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
@@ -31,13 +31,15 @@ | |||
#![feature(proc_macro)] | |||
#![feature(slice_patterns, box_syntax, box_patterns, fnbox)] | |||
#![allow(unused_parens)] | |||
// Cut down on number of warnings until we manage it. | |||
#![allow(non_snake_case, non_camel_case_types, unused_imports, unused_variables, dead_code)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
👏👏👏 Looks straightforward to me. I agree about using the |
Thanks! I'll merge this as-is for now, since the other PR depends on it, and make the remaining Either change after that one. BTW, do you prefer merge or rebase? |
@birkenfeld Rebase :) But until we get to a viable alpha release, I'm not a stickler for either. |
I have only done this where the Left variant was an obvious error
indication. There are a few Eithers left that can either stay
(use the either crate in that case?) or be replaced by domain-specific
enums.
Changes in
analysis
are unchecked, see #9.Fixes #3