Skip to content

Commit 5ce536c

Browse files
One less TODO
1 parent c50897d commit 5ce536c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/base/objc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ extern "C" {
4444
) -> ptr::objc::NullableRawPtr;
4545
}
4646

47-
// TODO: Is that really safe?
4847
impl<T> ptr::Retain for T
4948
where
5049
T: ptr::AsRaw + ptr::FromOwned,
5150
{
5251
type Owned = Self;
5352

5453
fn retain(&self) -> Self::Owned {
54+
// We are sure the source and destination type are the same so that should be safe.
5555
unsafe { Self::from_owned_ptr_unchecked(self.as_raw_ptr().retain()) }
5656
}
5757
}

0 commit comments

Comments
 (0)