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

Add simple take_one #1364

Closed
wants to merge 1 commit into from
Closed

Add simple take_one #1364

wants to merge 1 commit into from

Conversation

Stargateur
Copy link
Contributor

Simple equivalent of anychar() unfortunately I try to make it generic over input but it's related quite difficult:

  • InputIter could have a split_first but array implementation prevent fn split_first(&self) -> Option<(Self::Item, Self)> cause this require to return Self but Self is reduce by one so the returned array is not Self anymore.
  • InputTake doesn't have Sized to return Self and doesn't have Item I try to add Self: InputIter but I don't know if this would require GAT to compile I didn't succeed.

Anyway, this combinator only make sense for thing that contains u8, so I guess taking a &[u8] is ok.

PS: I wonder if the implementation for array of InputTake is really useful and not just a bit limiter to what we can do with nom trait.

@Stargateur Stargateur marked this pull request as draft August 18, 2021 19:22
@Stargateur
Copy link
Contributor Author

I having problem check doc test cause rust-lang/cargo#6424

@Stargateur
Copy link
Contributor Author

right now I feel this is not very useful unless someone know how to make it generic.

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