Is there some way to delete items meeting a predicate from maps that doesn’t require using external memory? I could only find Vec::retain.
If the answer is no (which I suspect), I’m half-tempted to open an RFC to extend retain to other types. Is there any obvious issue that prevents it? I don’t want to go through the trouble of the RFC process if it’s very obvious why this method only exists for Vec.
My particular use case is removing items older than a certain time from a hashMap. The code I just wrote only has to deal with 4 or 5 items, so it’s not that big a deal. But I shortly need to write some code that deals with thousands of them.
Any help is appreciated.