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

Interpolate arbitrary Iterator multiple times #229

Open
lukaslihotzki opened this issue Sep 8, 2022 · 0 comments · May be fixed by #230
Open

Interpolate arbitrary Iterator multiple times #229

lukaslihotzki opened this issue Sep 8, 2022 · 0 comments · May be fixed by #230

Comments

@lukaslihotzki
Copy link

Interpolation does support arbitrary Iterators, but they only can be used once. The types that can be used multiple times seem to be hardcoded in src/runtime.rs ([T], Vec<T>, BTreeSet<T>). References and RepInterp do not seem useful for this case because Iterators usually aren't Copy.

Possible fixes:

  • Call clone on the Iterator if it is used multiple times.
  • Support arbitrary IntoIterator, which can be used multiple times idiomatically. This could also replace the special casing for [T], Vec<T>, and BTreeSet<T>.
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 a pull request may close this issue.

1 participant