#(FnMut, FnMut)
1 messages · Page 1 of 1 (latest)
No, it is not possible. However:
-
I had exactly the same problem and just yesterday realized that I can combine them into one closure with another argument telling it which of the two things to do (in my case, a boolean, but an enum would also work and allow it to have different fields for the two cases).
-
Before then, I was using a
RefCellwrapped around the mutable reference they both wanted to use. -
If they have very different signatures then you can make both functions be methods in a trait, instead; this means you have to replace the closure with a
struct+impl, though.
Of these, only option 2 is possible if you don't control the code calling the functions.