From 0c8164776c6cfe881a4820cf4d2f53a490433c68 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Wed, 22 Feb 2023 09:55:16 +0100 Subject: [PATCH] Lower MSRV to 1.64 --- .github/workflows/capi.yaml | 2 +- .github/workflows/rust.yml | 2 +- Cargo.toml | 2 +- README.md | 2 +- docs/installation.md | 2 +- pineappl/src/grid.rs | 9 +++++++-- pineappl_cli/src/import/fastnlo.rs | 9 +++++++-- 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/capi.yaml b/.github/workflows/capi.yaml index d67c81be..a87136fc 100644 --- a/.github/workflows/capi.yaml +++ b/.github/workflows/capi.yaml @@ -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: | diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1a709d85..d99992cd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 34e896f7..c209c18a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/README.md b/README.md index ab294f46..5ea3f716 100644 --- a/README.md +++ b/README.md @@ -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? diff --git a/docs/installation.md b/docs/installation.md index a9c798df..ab3ab382 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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 and follow the instructions there. diff --git a/pineappl/src/grid.rs b/pineappl/src/grid.rs index 455e2cf0..6f986178 100644 --- a/pineappl/src/grid.rs +++ b/pineappl/src/grid.rs @@ -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; diff --git a/pineappl_cli/src/import/fastnlo.rs b/pineappl_cli/src/import/fastnlo.rs index 9e3432b0..deb96045 100644 --- a/pineappl_cli/src/import/fastnlo.rs +++ b/pineappl_cli/src/import/fastnlo.rs @@ -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;