-
Notifications
You must be signed in to change notification settings - Fork 203
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
Handle empty parser_options more reliably #163
Conversation
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.
I agree with fix, but I don't like that we're checking the presence of the option twice. If we check them here then no need to check when calling parse
Sorry @iMacTia I pushed some changes and lost the context of the review, had to move to next as returns from the proc do not work, I think I might have already covered your feedback as I had pushed up before I removed the second if. |
Sorry @stefansedich I couldn't be very specific as I was on mobile. You added this "if" but we shouldn't need it anymore, I think you can always pass both parameters as on the other side there's a block (which in theory accepts a dynamic number of parameters). |
I get it now @iMacTia I removed that IF and we should be good to go, just looking at my original PR you had mentioned:
Looking at this again I don't think it matters as any block params not used are just ignored so it should be fine, thoughts? |
Yeah you're right, I came out with that requirement in the first place. |
Based on the discussion in #156 I decided to take the path of least resistance and if there are no parser_options just call .parse without them, I did this instead of defaulting the options to {} to remove any other future surprises.