Skip to content

Commit

Permalink
Merge pull request #363 from xcshuan/main
Browse files Browse the repository at this point in the history
fix num-traits with no-std
  • Loading branch information
prestwich authored Mar 29, 2024
2 parents 7b8b0d3 + 07f8895 commit 41c45f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- add `alloc` requirement to `num-traits` feature [#363]

[#363]: https://github.com/recmo/uint/pull/363

## [1.12.1] - 2024-03-12

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ruint"
description = "Unsigned integer type with const-generic bit length"
version = "1.12.1"
version = "1.12.2"
keywords = ["uint"]
categories = ["mathematics"]
include = [".cargo/", "src/", "README.md"]
Expand Down Expand Up @@ -125,6 +125,7 @@ ark-ff-04 = ["dep:ark-ff-04"]
bn-rs = ["dep:bn-rs", "std"]
fastrlp = ["dep:fastrlp", "alloc"]
num-bigint = ["dep:num-bigint", "alloc"]
num-traits = ["dep:num-traits", "alloc"]
parity-scale-codec = ["dep:parity-scale-codec", "alloc"]
primitive-types = ["dep:primitive-types"]
proptest = ["dep:proptest", "std"] # TODO: change to "alloc" on the next proptest release (>1.2.0)
Expand Down
3 changes: 3 additions & 0 deletions src/support/num_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ use num_traits::{
CheckedEuclid, Euclid, Inv, MulAdd, MulAddAssign, Num, NumCast,
};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

// TODO: AsPrimitive

// Note. We can not implement `NumBytes` as it requires T to be `AsMut<[u8]>`.
Expand Down

0 comments on commit 41c45f8

Please sign in to comment.