Skip to content

Commit ef80c45

Browse files
authored
Replace const-cast marker with PhantomData
1 parent 289d05b commit ef80c45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reference_wrapper.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl<'a, T: ?Sized> CppRef<'a, T> {
162162
pub fn const_cast(&self) -> CppMutRef<'a, T> {
163163
CppMutRef {
164164
ptr: self.ptr as *mut T,
165-
phantom: self.phantom,
165+
phantom: PhantomData,
166166
}
167167
}
168168

@@ -296,7 +296,7 @@ impl<'a, T> From<CppMutRef<'a, T>> for CppRef<'a, T> {
296296
fn from(mutable: CppMutRef<'a, T>) -> Self {
297297
Self {
298298
ptr: mutable.ptr,
299-
phantom: mutable.phantom,
299+
phantom: PhantomData,
300300
}
301301
}
302302
}

0 commit comments

Comments
 (0)