Merge pull request #2848 from fitzgen/map-or-in-table-element-into-raw
Use `map_or` instead of `map` and `unwrap_or` in `TableElement::into_raw`
This commit is contained in:
@@ -71,7 +71,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()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user