Skip to content

Commit 26da522

Browse files
authored
MSRV 1.85, Edition 2024 (#28)
1 parent 0ae9855 commit 26da522

25 files changed

+46
-64
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- os: ubuntu-latest
7070
target: x86_64-unknown-linux-gnu
7171
variant: MSRV
72-
toolchain: 1.63.0
72+
toolchain: 1.85.0
7373
- os: ubuntu-latest
7474
deps: sudo apt-get update ; sudo apt install gcc-multilib
7575
target: i686-unknown-linux-gnu

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.6.0] — Unreleased
8+
- Bump to MSRV 1.85.0 and Edition 2024 in line with `rand` (#27)
9+
710
## [0.5.2]
811

912
### API Changes

Cargo.lock.msrv

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Sampling from random number distributions
1212
"""
1313
keywords = ["random", "rng", "distribution", "probability"]
1414
categories = ["algorithms", "no-std"]
15-
edition = "2021"
16-
rust-version = "1.63"
15+
edition = "2024"
16+
rust-version = "1.85"
1717
include = ["/src", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"]
1818

1919
[package.metadata.docs.rs]

benches/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "benches"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66

77
[dependencies]

benches/benches/distr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
use criterion::{criterion_group, criterion_main, Criterion, Throughput};
9+
use criterion::{Criterion, Throughput, criterion_group, criterion_main};
1010
use criterion_cycles_per_byte::CyclesPerByte;
1111

1212
use rand::prelude::*;

benches/benches/weighted.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// option. This file may not be copied, modified, or distributed
77
// except according to those terms.
88

9-
use criterion::{black_box, criterion_group, criterion_main, Criterion};
9+
use criterion::{Criterion, black_box, criterion_group, criterion_main};
1010
use rand::distr::weighted::WeightedIndex;
1111
use rand::prelude::*;
1212
use rand::seq::index::sample_weighted;

distr_test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "distr_test"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66

77
[dev-dependencies]

distr_test/tests/cdf.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,7 @@ fn studend_t() {
252252
fn cdf(x: f64, df: f64) -> f64 {
253253
let h = df / (df + x.powi(2));
254254
let ib = 0.5 * h.inc_beta(df / 2.0, 0.5, 0.5.ln_beta(df / 2.0));
255-
if x < 0.0 {
256-
ib
257-
} else {
258-
1.0 - ib
259-
}
255+
if x < 0.0 { ib } else { 1.0 - ib }
260256
}
261257

262258
let parameters = [1.0, 10.0, 50.0];
@@ -436,11 +432,7 @@ fn poisson() {
436432
let dist = Poisson::new(lambda).unwrap();
437433
let analytic = statrs::distribution::Poisson::new(lambda).unwrap();
438434
test_discrete::<f64, Poisson<f64>, _>(seed as u64, dist, |k| {
439-
if k < 0 {
440-
0.0
441-
} else {
442-
analytic.cdf(k as u64)
443-
}
435+
if k < 0 { 0.0 } else { analytic.cdf(k as u64) }
444436
});
445437
}
446438
}

distr_test/tests/weighted.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ fn make_cdf(num: usize, f: impl Fn(i64) -> f64) -> impl Fn(i64) -> f64 {
2727
}
2828

2929
move |i| {
30-
if i < 0 {
31-
0.0
32-
} else {
33-
cdf[i as usize]
34-
}
30+
if i < 0 { 0.0 } else { cdf[i as usize] }
3531
}
3632
}
3733

@@ -167,11 +163,7 @@ fn choose_two_weighted_indexed() {
167163
assert!((cdf.last().unwrap() - 1.0).abs() < 1e-9);
168164

169165
let cdf = |i| {
170-
if i < 0 {
171-
0.0
172-
} else {
173-
cdf[i as usize]
174-
}
166+
if i < 0 { 0.0 } else { cdf[i as usize] }
175167
};
176168

177169
test_discrete(0, distr, cdf);

0 commit comments

Comments
 (0)