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>.
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 andRepInterpdo not seem useful for this case because Iterators usually aren'tCopy.Possible fixes:
[T],Vec<T>, andBTreeSet<T>.