Add guidance about documenting FnMut order #197
Replies: 3 comments
-
It seems to me this isn't specific to Documenting the order can also over-commit to an implementation that you may want to change later for assorted purposes (optimization, ...). However, I think if you want to not commit to an order, it would be best to document the non-commitment. |
Beta Was this translation helpful? Give feedback.
-
Yes, there's definitely the contrapositive that if you don't want to commit to the order you should consider only accepting |
Beta Was this translation helpful? Give feedback.
-
You shouldn't be changing what Fns you take in that way. Fn can mutate things with interior mutability (RefCell/Cell/Mutex, etc). The names are to help out a bit with intuition, but the real meaning of the Fn traits in bounds is how they're used:
(Fn is almost completely unused in bounds, since that's a pretty specific scenario) |
Beta Was this translation helpful? Give feedback.
-
Inspired by rust-lang/rust#60396, I was pondering if it would be good to have something like
Beta Was this translation helpful? Give feedback.
All reactions