Skip to content

Commit 495d898

Browse files
committedAug 27, 2023
Docs
1 parent 609d13c commit 495d898

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed
 

‎CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Added
1313

1414
- `bytemuck` feature ([#292])
15+
- `num-traits` features ([#298])
16+
17+
[#292]: https://github.com/recmo/uint/pulls/292
18+
[#298]: https://github.com/recmo/uint/pulls/298
19+
20+
### Fixed
21+
22+
- `leading_ones` failed for non-aligned sizes.
1523

1624
## [1.10.1] - 2023-07-30
1725

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ named feature flag.
152152
* [`parity-scale-codec`](https://docs.rs/parity-scale-codec): Implements the [`Encode`](https://docs.rs/parity-scale-codec/latest/parity_scale_codec/trait.Encode.html), [`Decode`](https://docs.rs/parity-scale-codec/latest/parity_scale_codec/trait.Decode.html), [`MaxEncodedLen`](https://github.com/paritytech/parity-scale-codec/blob/47d98a1c23dabc890fdb548d115a18070082c66e/src/max_encoded_len.rs) and [`HasCompact`](https://docs.rs/parity-scale-codec/latest/parity_scale_codec/trait.HasCompact.html) traits.
153153
* [`bn-rs`](https://docs.rs/bn-rs/latest/bn_rs/): Implements conversion to/from the [`BN`](https://docs.rs/bn-rs/latest/bn_rs/struct.BN.html) and [`BigNumber`](https://docs.rs/bn-rs/latest/bn_rs/struct.BigNumber.html).
154154
* [`bytemuck`](https://docs.rs/bytemuck): Implements the [`Pod`](https://docs.rs/bytemuck/latest/bytemuck/trait.Pod.html) and [`Zeroable`](https://docs.rs/bytemuck/latest/bytemuck/trait.Zeroable.html) traits for [`Uint`] where the size is a multiple of 64, up to 1024. This allows `Uint` to be used where a `Pod` trait bound exists.
155-
155+
* [`num-traits`](https://docs.rs/num-traits): Implements about forty applicable traits.
156156

157157
## Building and testing
158158

‎src/support/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ mod valuable;
2323
mod zeroize;
2424

2525
// FEATURE: Support for many more traits and crates.
26-
// * https://crates.io/crates/num-traits
2726
// * https://crates.io/crates/der
2827
// * https://crates.io/crates/bitvec
2928

‎src/support/num_traits.rs

+3
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,14 @@ impl<const BITS: usize, const LIMBS: usize> Shr<u32> for Uint<BITS, LIMBS> {
132132
}
133133

134134
impl<const BITS: usize, const LIMBS: usize> CheckedShl for Uint<BITS, LIMBS> {
135+
#[inline(always)]
135136
fn checked_shl(&self, other: u32) -> Option<Self> {
136137
Uint::checked_shl(*self, other as usize)
137138
}
138139
}
139140

140141
impl<const BITS: usize, const LIMBS: usize> CheckedShr for Uint<BITS, LIMBS> {
142+
#[inline(always)]
141143
fn checked_shr(&self, other: u32) -> Option<Self> {
142144
Uint::checked_shr(*self, other as usize)
143145
}
@@ -413,6 +415,7 @@ impl<const BITS: usize, const LIMBS: usize> PrimInt for Uint<BITS, LIMBS> {
413415
Self::try_from_be_slice(&bytes).unwrap()
414416
}
415417

418+
#[inline(always)]
416419
fn reverse_bits(self) -> Self {
417420
<Self>::reverse_bits(self)
418421
}

0 commit comments

Comments
 (0)
Please sign in to comment.