diff options
| author | bors <bors@rust-lang.org> | 2015-06-04 06:08:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-06-04 06:08:42 +0000 |
| commit | 80d08a37b6215a59ecce042f36ad446c5357b543 (patch) | |
| tree | 147ef026a01aa677869ec668e64b27dbf16056e3 | |
| parent | 06c6b3caaf5fdd79be11377492547639dc975652 (diff) | |
| parent | 7972a000e3bb625ed6daa5db8adc2f7b42e69e64 (diff) | |
Auto merge of #25991 - Jexell:master, r=alexcrichton
Removed an unnecessary `transmute` and replaced some code with an equivalent method.
| -rw-r--r-- | src/libcollections/linked_list.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index 61ebf7f6df9..7c045c45376 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -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() } } |
