Auto merge of #25991 - Jexell:master, r=alexcrichton

Removed an unnecessary `transmute` and replaced some code with an equivalent method.
This commit is contained in:
bors 2015-06-04 06:08:42 +00:00
commit 80d08a37b6

View file

@ -106,16 +106,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()
}
}