You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if the title is all that self-explanatory, but it's the best I could think of, so let me instead try to explain what I mean here:
Today, RwLockReadGuard takes a closure with the signature FnOnce(&T) -> &U, which means that the only thing you can do is return a borrowed value. This means you can't do something like
structMyCustomType<'a>{value:&'aValue,}// used with `map` like:RwLockReadGuard::map(guard, |value| MyCustomType{
value,})
since, although this is still a sensible mapping, it does not fit the shape of a &U and will be rejected.
The text was updated successfully, but these errors were encountered:
I don't know if the title is all that self-explanatory, but it's the best I could think of, so let me instead try to explain what I mean here:
Today,
RwLockReadGuard
takes a closure with the signatureFnOnce(&T) -> &U
, which means that the only thing you can do is return a borrowed value. This means you can't do something likesince, although this is still a sensible mapping, it does not fit the shape of a
&U
and will be rejected.The text was updated successfully, but these errors were encountered: