@@ -70,10 +70,12 @@ use pineappl::subgrid::{ImportSubgridV1, Subgrid as _};
7070use std:: collections:: HashMap ;
7171use std:: ffi:: { CStr , CString } ;
7272use std:: fs:: File ;
73+ use std:: io:: Error as IoError ;
7374use std:: mem;
7475use std:: os:: raw:: { c_char, c_void} ;
7576use std:: path:: Path ;
7677use std:: slice;
78+ use std:: ptr;
7779
7880/// Select subgrid type optimization when passed to grid optimization (see `GridOptFlags::OPTIMIZE_SUBGRID_TYPE`).
7981pub const PINEAPPL_GOF_OPTIMIZE_SUBGRID_TYPE : GridOptFlags = GridOptFlags :: OPTIMIZE_SUBGRID_TYPE ;
@@ -948,7 +950,7 @@ pub unsafe extern "C" fn pineappl_grid_delete_bins(
948950 bin_indices_len : usize ,
949951) {
950952 let grid = unsafe { & mut * grid } ;
951- let bin_indices = unsafe { std :: slice:: from_raw_parts ( bin_indices_ptr, bin_indices_len) } ;
953+ let bin_indices = unsafe { slice:: from_raw_parts ( bin_indices_ptr, bin_indices_len) } ;
952954 grid. delete_bins ( bin_indices) ;
953955}
954956
@@ -1730,7 +1732,7 @@ pub unsafe extern "C" fn pineappl_grid_new2(
17301732 let convolutions = unsafe { slice:: from_raw_parts ( convolutions, nb_convolutions) } . to_vec ( ) ;
17311733
17321734 // Grid interpolations
1733- let interp_slices = unsafe { std :: slice:: from_raw_parts ( interps, interpolations) } ;
1735+ let interp_slices = unsafe { slice:: from_raw_parts ( interps, interpolations) } ;
17341736 let interp_vecs: Vec < _ > = interp_slices
17351737 . iter ( )
17361738 . map ( |interp| {
@@ -1750,7 +1752,7 @@ pub unsafe extern "C" fn pineappl_grid_new2(
17501752 let kinematics = unsafe { slice:: from_raw_parts ( kinematics, interp_vecs. len ( ) ) } . to_vec ( ) ;
17511753
17521754 // Scales. An array containing the values of `ScaleFuncForm` objects
1753- let mu_scales = unsafe { std :: slice:: from_raw_parts ( scales, 3 ) } ;
1755+ let mu_scales = unsafe { slice:: from_raw_parts ( scales, 3 ) } ;
17541756
17551757 Box :: new ( Grid :: new (
17561758 bins,
@@ -1918,7 +1920,7 @@ pub unsafe extern "C" fn pineappl_grid_metadata(
19181920
19191921 grid. metadata ( )
19201922 . get ( key. as_ref ( ) )
1921- . map_or ( std :: ptr:: null_mut ( ) , |value| {
1923+ . map_or ( ptr:: null_mut ( ) , |value| {
19221924 CString :: new ( value. as_str ( ) ) . unwrap ( ) . into_raw ( )
19231925 } )
19241926}
@@ -2492,7 +2494,7 @@ pub unsafe extern "C" fn pineappl_grid_evolve(
24922494 }
24932495
24942496 // we specify an arbitrary error type since we don't return an error anywhere
2495- Ok :: < _ , std :: io :: Error > ( ( operator_slice_info, array) )
2497+ Ok :: < _ , IoError > ( ( operator_slice_info, array) )
24962498 } )
24972499 } )
24982500 . collect ( ) ;
@@ -2527,10 +2529,10 @@ pub unsafe extern "C" fn pineappl_grid_evolve(
25272529pub unsafe extern "C" fn pineappl_fktable_optimize ( grid : * mut Grid , assumptions : FkAssumptions ) {
25282530 let grid = unsafe { & mut * grid } ;
25292531 // SAFETY: this code has been copied from the `take_mut` crate
2530- let read_grid = unsafe { std :: ptr:: read ( grid) } ;
2532+ let read_grid = unsafe { ptr:: read ( grid) } ;
25312533 let mut fktable = FkTable :: try_from ( read_grid)
25322534 // UNWRAP: error handling in the CAPI is to abort
25332535 . unwrap ( ) ;
25342536 fktable. optimize ( assumptions) ;
2535- unsafe { std :: ptr:: write ( grid, fktable. into_grid ( ) ) } ;
2537+ unsafe { ptr:: write ( grid, fktable. into_grid ( ) ) } ;
25362538}
0 commit comments