Browse Source

Fix unused result that is `#[must_use]` (#4663)

Fixes this compiler warning:

```
warning: unused return value of `Box::<T>::from_raw` that must be used
   --> crates/bench-api/src/lib.rs:351:9
    |
351 |         Box::from_raw(state as *mut BenchState);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
```
pull/4668/head
Nick Fitzgerald 2 years ago
committed by GitHub
parent
commit
b17a734a57
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      crates/bench-api/src/lib.rs

2
crates/bench-api/src/lib.rs

@ -348,7 +348,7 @@ pub extern "C" fn wasm_bench_create(
pub extern "C" fn wasm_bench_free(state: *mut c_void) {
assert!(!state.is_null());
unsafe {
Box::from_raw(state as *mut BenchState);
drop(Box::from_raw(state as *mut BenchState));
}
}

Loading…
Cancel
Save