dtolnay / dtolnay/quote

Interpolate arbitrary Iterator multiple times

Open
#229 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.6k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/dtolnay/quote/blob/master/src/runtime.rs) (`[T]`, `Vec`, `BTreeSet`). 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`, and `BTreeSet`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.