Skip to content

Commit

Permalink
Convert unreachable to assert_eq
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Mar 11, 2024
1 parent f012f59 commit 6c0fdd8
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions pineappl_cli/src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ impl Subcommand for Opts {
let values1: Vec<_> = pdfset1
.par_iter_mut()
.map(|pdf| {
match helpers::convolute(
let values = helpers::convolute(
&grid,
pdf,
&[],
Expand All @@ -532,18 +532,15 @@ impl Subcommand for Opts {
1,
ConvoluteMode::Normal,
cfg,
)
.as_slice()
{
[value] => *value,
_ => unreachable!(),
}
);
assert_eq!(values.len(), 1);
values[0]
})
.collect();
let values2: Vec<_> = pdfset2
.par_iter_mut()
.map(|pdf| {
match helpers::convolute(
let values = helpers::convolute(
&grid,
pdf,
&[],
Expand All @@ -552,12 +549,9 @@ impl Subcommand for Opts {
1,
ConvoluteMode::Normal,
cfg,
)
.as_slice()
{
[value] => *value,
_ => unreachable!(),
}
);
assert_eq!(values.len(), 1);
values[0]
})
.collect();

Expand Down

0 comments on commit 6c0fdd8

Please sign in to comment.