Use map_or instead of map and unwrap_or in TableElement::into_raw

This commit is contained in:
Nick Fitzgerald
2021-04-19 14:18:55 -07:00
parent 36c667d58d
commit 8507eb7708

View File

@@ -69,7 +69,7 @@ impl TableElement {
unsafe fn into_raw(self) -> *mut u8 {
match self {
Self::FuncRef(e) => e as _,
Self::ExternRef(e) => e.map(|e| e.into_raw()).unwrap_or(ptr::null_mut()),
Self::ExternRef(e) => e.map_or(ptr::null_mut(), |e| e.into_raw()),
}
}
}