@@ -71,15 +71,15 @@ impl<T> Retained<T> {
71
71
///
72
72
/// TODO: Something about there not being any mutable references.
73
73
#[ inline]
74
- pub const unsafe fn new ( ptr : NonNull < T > ) -> Self {
75
- Retained {
74
+ pub unsafe fn new ( ptr : NonNull < T > ) -> Self {
75
+ Self {
76
76
ptr,
77
77
phantom : PhantomData ,
78
78
}
79
79
}
80
80
81
81
#[ inline]
82
- pub const fn as_ptr ( & self ) -> * mut T {
82
+ pub fn as_ptr ( & self ) -> * mut T {
83
83
self . ptr . as_ptr ( )
84
84
}
85
85
@@ -96,7 +96,7 @@ impl<T> Retained<T> {
96
96
// SAFETY: The caller upholds that the pointer is valid
97
97
let rtn = runtime:: objc_retain ( ptr. as_ptr ( ) as * mut Object ) ;
98
98
debug_assert_eq ! ( rtn, ptr. as_ptr( ) as * mut Object ) ;
99
- Retained {
99
+ Self {
100
100
ptr,
101
101
phantom : PhantomData ,
102
102
}
@@ -167,12 +167,12 @@ impl<T> Deref for Retained<T> {
167
167
168
168
impl < T : PartialEq > PartialEq for Retained < T > {
169
169
#[ inline]
170
- fn eq ( & self , other : & Retained < T > ) -> bool {
170
+ fn eq ( & self , other : & Self ) -> bool {
171
171
& * * self == & * * other
172
172
}
173
173
174
174
#[ inline]
175
- fn ne ( & self , other : & Retained < T > ) -> bool {
175
+ fn ne ( & self , other : & Self ) -> bool {
176
176
& * * self != & * * other
177
177
}
178
178
}
@@ -193,7 +193,7 @@ impl<T: fmt::Debug> fmt::Debug for Retained<T> {
193
193
194
194
impl < T > fmt:: Pointer for Retained < T > {
195
195
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
196
- fmt:: Pointer :: fmt ( & self . as_ptr ( ) , f)
196
+ fmt:: Pointer :: fmt ( & self . ptr . as_ptr ( ) , f)
197
197
}
198
198
}
199
199
0 commit comments