diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 61ebf7f6df91..7c045c453762 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -106,16 +106,14 @@ impl Rawlink { /// 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() } }