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