Skip to content

Interpolate arbitrary Iterator multiple times #229

@lukaslihotzki

Description

@lukaslihotzki

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>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions