simplify code in box pin

This commit is contained in:
doki 2022-05-07 20:14:28 +08:00 committed by Taiki Endo
parent 73cdf319ab
commit cd52d085d8
1 changed files with 1 additions and 1 deletions

View File

@ -568,7 +568,7 @@ impl Test {
_marker: PhantomPinned,
};
let mut boxed = Box::pin(t);
let self_ptr: *const String = &boxed.as_ref().a;
let self_ptr: *const String = &boxed.a;
unsafe { boxed.as_mut().get_unchecked_mut().b = self_ptr };
boxed