Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks! I originally wanted to do it all with the first iterator so that I didn't have to deal with the time of insert, but I quickly aborted out of that, since it probably would've been even messier. Shame that there's not a convenient way to define a state machine for iterators or something like that (or maybe there is in which case I'd really like to try it!).

    Edit: Well after writing that, I thought about using Iterator::scan and maybe trying generators on nightly, but given that scan has mutable references as part of its design and generators are still in nightly it seems like they are also not quite ideal solutions.