We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c50897d commit 5ce536cCopy full SHA for 5ce536c
src/base/objc.rs
@@ -44,14 +44,14 @@ extern "C" {
44
) -> ptr::objc::NullableRawPtr;
45
}
46
47
-// TODO: Is that really safe?
48
impl<T> ptr::Retain for T
49
where
50
T: ptr::AsRaw + ptr::FromOwned,
51
{
52
type Owned = Self;
53
54
fn retain(&self) -> Self::Owned {
+ // We are sure the source and destination type are the same so that should be safe.
55
unsafe { Self::from_owned_ptr_unchecked(self.as_raw_ptr().retain()) }
56
57
0 commit comments