You hit a known limitation of the current borrow checker. It compiles with the next-gen checker (Polonius).
See more detail in this similar thread. Applying @steffahn's workaround in that thread works for your code as well.
You hit a known limitation of the current borrow checker. It compiles with the next-gen checker (Polonius).
See more detail in this similar thread. Applying @steffahn's workaround in that thread works for your code as well.