Skip to content

Commit

Permalink
Lower MSRV to 1.64
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Feb 22, 2023
1 parent 2eba846 commit 0c81647
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/capi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
default: true
toolchain: 1.65.0
toolchain: 1.64.0

- name: Install cargo-c
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
default: true
toolchain: 1.65.0
toolchain: 1.64.0
components: llvm-tools-preview
- name: Get test data
id: cache-test-data
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ edition = "2021"
keywords = ["high-energy-physics", "physics"]
license = "GPL-3.0-or-later"
repository = "https://github.com/NNPDF/pineappl"
rust-version = "1.65.0"
rust-version = "1.64.0"
version = "0.5.9"

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![codecov](https://codecov.io/gh/NNPDF/pineappl/branch/master/graph/badge.svg)](https://codecov.io/gh/NNPDF/pineappl)
[![Documentation](https://docs.rs/pineappl/badge.svg)](https://docs.rs/pineappl)
[![crates.io](https://img.shields.io/crates/v/pineappl.svg)](https://crates.io/crates/pineappl)
[![MSRV](https://img.shields.io/badge/Rust-1.65+-lightgray.svg)](docs/installation.md)
[![MSRV](https://img.shields.io/badge/Rust-1.64+-lightgray.svg)](docs/installation.md)

# What is PineAPPL?

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ already installed, make sure it is recent enough:

cargo --version

This should show a version that is at least 1.65.0. If you do not have `cargo`
This should show a version that is at least 1.64.0. If you do not have `cargo`
or if it is too old, go to <https://www.rust-lang.org/tools/install> and follow
the instructions there.

Expand Down
9 changes: 7 additions & 2 deletions pineappl/src/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,13 @@ impl Grid {
continue;
}

let Some(bin_index) = bin_indices.iter().position(|&index| index == bin)
else { continue };
// TODO: use let-else statement when MSRV is 1.65
let bin_index =
if let Some(bin) = bin_indices.iter().position(|&index| index == bin) {
bin
} else {
continue;
};

if subgrid.is_empty() {
continue;
Expand Down
9 changes: 7 additions & 2 deletions pineappl_cli/src/import/fastnlo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,13 @@ pub fn convert_fastnlo_table(file: &fastNLOLHAPDF, alpha: u32, dis_pid: i32) ->
// TODO: there doesn't seem to be a better way than trying an index and stopping whenever a
// NULL pointer is returned
let coeff_base = file_as_table.GetCoeffTable(id);
let Some(coeff_base) = (unsafe { coeff_base.as_ref() })
else { break; };

// TODO: use let-else statement when MSRV is 1.65
let coeff_base = if let Some(base) = unsafe { coeff_base.as_ref() } {
base
} else {
break;
};

if !coeff_base.IsEnabled() {
break;
Expand Down

0 comments on commit 0c81647

Please sign in to comment.