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

Find a way to unify select! and select_ref! #309

Open
zesterer opened this issue Mar 1, 2023 · 0 comments
Open

Find a way to unify select! and select_ref! #309

zesterer opened this issue Mar 1, 2023 · 0 comments
Labels
1.0 Features that should be implemented for the 1.0 release api A problem with the design of an API feature

Comments

@zesterer
Copy link
Owner

zesterer commented Mar 1, 2023

Currently, zero-copy differentiates between select! and select_ref!: the former selects upon tokens by-value, the other by-ref.

The former is required for inputs that do not implement BorrowInput (i.e: those from which tokens cannot be borrowed, such as char from &str or T from Stream<T>), while the latter is required for cases where a reference to the original input is required (such as for parsing nested inputs).

It would be nice to unify these two cases into a single macro, ideally without requiring users to understand the intricate details.

@zesterer zesterer added api A problem with the design of an API feature 1.0 Features that should be implemented for the 1.0 release labels Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Features that should be implemented for the 1.0 release api A problem with the design of an API feature
Projects
None yet
Development

No branches or pull requests

1 participant