Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing import for no_std builds #13

Merged
merged 4 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ jobs:
if: ${{ matrix.variant == 'minimal_versions' }}
run: |
cargo generate-lockfile -Z minimal-versions
- name: Build rand_distr
run: |
cargo build --target ${{ matrix.target }} --features=serde
cargo build --target ${{ matrix.target }} --no-default-features
cargo build --target ${{ matrix.target }} --no-default-features --features=std,std_math
- name: Test rand_distr
run: |
cargo test --target ${{ matrix.target }} --features=serde
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.1]

### Testing
- Added building the crate to CI

### Fixes
- Fix missing import for `no_std` builds

## [0.5.0] - 2025-01-27

### Dependencies and features
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rand_distr"
version = "0.5.0"
version = "0.5.1"
authors = ["The Rand Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion distr_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[dev-dependencies]
rand_distr = { path = "..", version = "0.5.0", default-features = false, features = ["alloc"] }
rand_distr = { path = "..", version = "0.5.1", default-features = false, features = ["alloc"] }
rand = { version = "0.9.0", features = ["small_rng"] }
num-traits = "0.2.19"
# Special functions for testing distributions
Expand Down
2 changes: 2 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
//! Math helper functions

use crate::ziggurat_tables;
#[allow(unused_imports)]
use num_traits::Float; // Used for `no_std` to get `f64::abs()` working before `rustc 1.84`
use rand::distr::hidden_export::IntoFloat;
use rand::Rng;

Expand Down