Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
recmo committed Aug 27, 2023
1 parent 609d13c commit 495d898
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- `bytemuck` feature ([#292])
- `num-traits` features ([#298])

[#292]: https://github.com/recmo/uint/pulls/292
[#298]: https://github.com/recmo/uint/pulls/298

### Fixed

- `leading_ones` failed for non-aligned sizes.

## [1.10.1] - 2023-07-30

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ named feature flag.
* [`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.
* [`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).
* [`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.

* [`num-traits`](https://docs.rs/num-traits): Implements about forty applicable traits.

## Building and testing

Expand Down
1 change: 0 additions & 1 deletion src/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mod valuable;
mod zeroize;

// FEATURE: Support for many more traits and crates.
// * https://crates.io/crates/num-traits
// * https://crates.io/crates/der
// * https://crates.io/crates/bitvec

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 @@ -132,12 +132,14 @@ impl<const BITS: usize, const LIMBS: usize> Shr<u32> for Uint<BITS, LIMBS> {
}

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

impl<const BITS: usize, const LIMBS: usize> CheckedShr for Uint<BITS, LIMBS> {
#[inline(always)]
fn checked_shr(&self, other: u32) -> Option<Self> {
Uint::checked_shr(*self, other as usize)
}
Expand Down Expand Up @@ -413,6 +415,7 @@ impl<const BITS: usize, const LIMBS: usize> PrimInt for Uint<BITS, LIMBS> {
Self::try_from_be_slice(&bytes).unwrap()
}

#[inline(always)]
fn reverse_bits(self) -> Self {
<Self>::reverse_bits(self)
}
Expand Down

0 comments on commit 495d898

Please sign in to comment.