Skip to content

Commit

Permalink
Fix a few clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Dec 19, 2024
1 parent 66a01be commit 0d6f583
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pineappl_capi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub unsafe extern "C" fn pineappl_grid_convolve_with_one(
&mut convolution_cache,
order_mask,
&[],
&channel_mask,
channel_mask,
&[(xi_ren, xi_fac, 1.0)],
));
}
Expand Down Expand Up @@ -534,7 +534,7 @@ pub unsafe extern "C" fn pineappl_grid_convolve_with_two(
&mut convolution_cache,
order_mask,
&[],
&channel_mask,
channel_mask,
&[(xi_ren, xi_fac, 1.0)],
));
}
Expand Down Expand Up @@ -1063,7 +1063,7 @@ pub unsafe extern "C" fn pineappl_grid_write(grid: *const Grid, filename: *const
let path = Path::new(filename.as_ref());
let writer = File::create(path).unwrap();

if path.extension().map_or(false, |ext| ext == "lz4") {
if path.extension().is_some_and(|ext| ext == "lz4") {
grid.write_lz4(writer).unwrap();
} else {
grid.write(writer).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion pineappl_cli/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub fn write_grid(output: &Path, grid: &Grid) -> Result<ExitCode> {
.open(output)
.context(format!("unable to write '{}'", output.display()))?;

if output.extension().map_or(false, |ext| ext == "lz4") {
if output.extension().is_some_and(|ext| ext == "lz4") {
grid.write_lz4(file)?;
} else {
grid.write(file)?;
Expand Down
2 changes: 1 addition & 1 deletion pineappl_cli/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn convert_grid(
&& input
.with_extension("")
.extension()
.map_or(false, |ext| ext == "tab"))
.is_some_and(|ext| ext == "tab"))
{
return convert_fastnlo(input, alpha, fun_names, member, scales, fnlo_mur, fnlo_muf);
} else if extension == "dat" {
Expand Down
6 changes: 3 additions & 3 deletions pineappl_cli/src/plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ impl Subcommand for Opts {
.unwrap_or_else(|_| unreachable!());
}

data_string.push_str("]");
data_string.push(']');

// prepare metadata
let metadata = grid.metadata();
Expand Down Expand Up @@ -555,14 +555,14 @@ metadata = {{
let data_marker = template.find(MARKER_DATA_INSERT).unwrap();
// echo template and dynamic content
print!("{}", template.get(0..config_marker_begin).unwrap());
print!("{}", config);
print!("{config}");
print!(
"{}",
template
.get((config_marker_end + MARKER_CONFIG_END.len())..data_marker)
.unwrap()
);
print!("{}", data);
print!("{data}");
print!(
"{}",
template
Expand Down

0 comments on commit 0d6f583

Please sign in to comment.