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

Update FirstWhere.swift #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morstin
Copy link
Owner

@morstin morstin commented Aug 30, 2021

Dear all,

I have been trying to use FirstWhere with Substring.UTF8View. I find it not very useful that FirstWhere returns a Collection.Element - in this case a Substring.UTF8View.Element. I did not find a way to cast this Element back to Substring.UTF8View. It seems to me that the only way to use the Substring.UTF8View.Element is to create a new String.

Assuming this is correct, I wondered if it would not be easier if the parser would return Substring.UTF8View as lot of others parser do.

In my fork you see an implementation proposal.

Thank you very much for the great library and the great video series!
Morstin

@morstin morstin marked this pull request as ready for review August 30, 2021 20:38
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

Successfully merging this pull request may close these issues.

1 participant