Improve mapping features
There's an already open request about an owned_map feature that return a non-borrowed object. Please consider improving the API with other construct as well:
- map :
&T -> &(mut) U - filter_map :
&T -> Option<&(mut) U> - try_map :
&T -> Result<&(mut) U, E> - and their "owning" version as described in #11
I felt like this is a bit broader request as the #11, thus I've created a new issue.
I'd absolutely love this.
What I think would be great is a &mut (T, U) -> (&mut T, &mut U) because it is quite common to have a single refcell to lock multiple pieces of data, but you'd need to return them as disjoint references. Two atomic refcells does partly solve the issue, but required double borrowing each time
While this feature were great, but as there was no updated on the topic for a year, I'm closing the issue.