We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 06c6b3c + 7972a00 commit 80d08a3Copy full SHA for 80d08a3
src/libcollections/linked_list.rs
@@ -106,16 +106,14 @@ impl<T> Rawlink<T> {
106
/// Convert the `Rawlink` into an Option value
107
fn resolve_immut<'a>(&self) -> Option<&'a T> {
108
unsafe {
109
- mem::transmute(self.p.as_ref())
+ self.p.as_ref()
110
}
111
112
113
114
fn resolve<'a>(&mut self) -> Option<&'a mut T> {
115
- if self.p.is_null() {
116
- None
117
- } else {
118
- Some(unsafe { mem::transmute(self.p) })
+ unsafe {
+ self.p.as_mut()
119
120
121
0 commit comments