Use Cell::take in a couple places
This commit is contained in:
parent
f121f094fe
commit
4ea83bfb3d
4 changed files with 4 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ struct MyType<'a>(Cell<Option<&'a mut MyType<'a>>>, PhantomPinned);
|
|||
impl<'a> Clone for &'a mut MyType<'a> {
|
||||
//~^ ERROR E0751
|
||||
fn clone(&self) -> &'a mut MyType<'a> {
|
||||
self.0.replace(None).unwrap()
|
||||
self.0.take().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ struct MyType<'a>(Cell<Option<&'a mut MyType<'a>>>, PhantomPinned);
|
|||
impl<'a> DerefMut for &'a MyType<'a> {
|
||||
//~^ ERROR E0751
|
||||
fn deref_mut(&mut self) -> &mut MyType<'a> {
|
||||
self.0.replace(None).unwrap()
|
||||
self.0.take().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue