Skip to content

Commit

Permalink
Change PinMut::map to be able to preserve the original reference's li…
Browse files Browse the repository at this point in the history
…fetime

Suggested by @dylanede at <#49150 (comment)>.
  • Loading branch information
RalfJung committed May 7, 2018
1 parent 9f26376 commit 84ce206
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/mem.rs
Expand Up @@ -1155,7 +1155,7 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
/// because it is one of the fields of that value), and also that you do
/// not move out of the argument you receive to the interior function.
#[unstable(feature = "pin", issue = "49150")]
pub unsafe fn map<'b, U, F>(this: &'b mut PinMut<'a, T>, f: F) -> PinMut<'b, U> where
pub unsafe fn map<U, F>(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where
F: FnOnce(&mut T) -> &mut U
{
PinMut { inner: f(this.inner) }
Expand Down

0 comments on commit 84ce206

Please sign in to comment.