We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pineappl_fktable_optimize
1 parent 7ffc086 commit 093993bCopy full SHA for 093993b
1 file changed
pineappl_capi/src/lib.rs
@@ -2295,8 +2295,11 @@ pub unsafe extern "C" fn pineappl_grid_evolve(
2295
#[no_mangle]
2296
pub unsafe extern "C" fn pineappl_fktable_optimize(grid: *mut Grid, assumptions: FkAssumptions) {
2297
let grid = unsafe { &mut *grid };
2298
+ // SAFETY: this code has been copied from the `take_mut` crate
2299
let read_grid = unsafe { std::ptr::read(grid) };
- let mut fktable = FkTable::try_from(read_grid).unwrap();
2300
+ let mut fktable = FkTable::try_from(read_grid)
2301
+ // UNWRAP: error handling in the CAPI is to abort
2302
+ .unwrap();
2303
fktable.optimize(assumptions);
2304
unsafe { std::ptr::write(grid, fktable.into_grid()) };
2305
}
0 commit comments