about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libcollections/linked_list.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs
index 391439bcdf2..ca72bb56d73 100644
--- a/src/libcollections/linked_list.rs
+++ b/src/libcollections/linked_list.rs
@@ -107,16 +107,14 @@ impl<T> Rawlink<T> {
     /// Convert the `Rawlink` into an Option value
     fn resolve_immut<'a>(&self) -> Option<&'a T> {
         unsafe {
-            mem::transmute(self.p.as_ref())
+            self.p.as_ref()
         }
     }
 
     /// Convert the `Rawlink` into an Option value
     fn resolve<'a>(&mut self) -> Option<&'a mut T> {
-        if self.p.is_null() {
-            None
-        } else {
-            Some(unsafe { mem::transmute(self.p) })
+        unsafe {
+            self.p.as_mut()
         }
     }