Skip to content

Commit c5de6c7

Browse files
Fix missing import for no_std builds (#13)
1 parent a3e7ed3 commit c5de6c7

File tree

5 files changed

+17
-2
lines changed

5 files changed

+17
-2
lines changed

.github/workflows/test.yml

+5
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ jobs:
9494
if: ${{ matrix.variant == 'minimal_versions' }}
9595
run: |
9696
cargo generate-lockfile -Z minimal-versions
97+
- name: Build rand_distr
98+
run: |
99+
cargo build --target ${{ matrix.target }} --features=serde
100+
cargo build --target ${{ matrix.target }} --no-default-features
101+
cargo build --target ${{ matrix.target }} --no-default-features --features=std,std_math
97102
- name: Test rand_distr
98103
run: |
99104
cargo test --target ${{ matrix.target }} --features=serde

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ 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.5.1]
8+
9+
### Testing
10+
- Added building the crate to CI
11+
12+
### Fixes
13+
- Fix missing import for `no_std` builds
14+
715
## [0.5.0] - 2025-01-27
816

917
### Dependencies and features

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rand_distr"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
authors = ["The Rand Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

distr_test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55
publish = false
66

77
[dev-dependencies]
8-
rand_distr = { path = "..", version = "0.5.0", default-features = false, features = ["alloc"] }
8+
rand_distr = { path = "..", version = "0.5.1", default-features = false, features = ["alloc"] }
99
rand = { version = "0.9.0", features = ["small_rng"] }
1010
num-traits = "0.2.19"
1111
# Special functions for testing distributions

src/utils.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
//! Math helper functions
1010
1111
use crate::ziggurat_tables;
12+
#[allow(unused_imports)]
13+
use num_traits::Float; // Used for `no_std` to get `f64::abs()` working before `rustc 1.84`
1214
use rand::distr::hidden_export::IntoFloat;
1315
use rand::Rng;
1416

0 commit comments

Comments
 (0)