-
Notifications
You must be signed in to change notification settings - Fork 45
Fix character split when strip code #37
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
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.
can you document this variable? It's a bit unique.
I also feel like there must be a way to make it simpler. The range.0
is always the result of acc.0
, so basically the first take()
, and the range.1
should be chainable Option
on last element of take_while
so if you put the iterator as a mutable variable, you should be able to do iter.next().or(last)
.
The refactor is optional, and I'm happy to land this as-is with a comment explaining the variable and its role.
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.
This ended
specifies that it will end in the next character so it will return until the next one to the final condition. In order to measure this last character, when end condition is true, in an efficient way.
I will try to document it.
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 think I understand the role, but I had to run an iterator in my head to derive to that conclusion so a doc string would help.
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.
lgtm! Thank you!
I had made an error to strip code in margin. In cases such as coverage, it could panic.