From 5117ea1e17f84ef2729326bc9cd4b154aca9455a Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Mon, 2 Sep 2024 16:46:22 +0300 Subject: [PATCH] Swap map_or for unwrap_or --- pineappl_py/src/grid.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pineappl_py/src/grid.rs b/pineappl_py/src/grid.rs index b638909c..42e1c42e 100644 --- a/pineappl_py/src/grid.rs +++ b/pineappl_py/src/grid.rs @@ -280,10 +280,10 @@ impl PyGrid { self.grid .convolve( &mut lumi_cache, - &order_mask.map_or(vec![], |b| b.to_vec()), - &bin_indices.map_or(vec![], |c| c.to_vec()), - &channel_mask.map_or(vec![], |d| d.to_vec()), - &xi.map_or(vec![(1.0, 1.0)], |m| m), + &order_mask.unwrap_or(vec![]), + &bin_indices.unwrap_or(vec![]), + &channel_mask.unwrap_or(vec![]), + &xi.unwrap_or(vec![(1.0, 1.0)]), ) .into_pyarray_bound(py) } @@ -347,10 +347,10 @@ impl PyGrid { self.grid .convolve( &mut lumi_cache, - &order_mask.map_or(vec![], |b| b.to_vec()), - &bin_indices.map_or(vec![], |c| c.to_vec()), - &channel_mask.map_or(vec![], |d| d.to_vec()), - &xi.map_or(vec![(1.0, 1.0)], |m| m), + &order_mask.unwrap_or(vec![]), + &bin_indices.unwrap_or(vec![]), + &channel_mask.unwrap_or(vec![]), + &xi.unwrap_or(vec![(1.0, 1.0)]), ) .into_pyarray_bound(py) }