Skip to content

Releases: danlehmann/arbitrary-int

2.1.1 public release on crates.io

14 Feb 05:46
be712fc

Choose a tag to compare

Changed

Fixed

  • Fix bugs in masked_new() and from_ when converting signed to unsigned numbers by @danlehmann in #100

Full Changelog: 2.1.0...2.1.1

2.1.0 public release on crates.io

13 Feb 23:04
0b888b8

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.0.0...2.1.0

2.0.0

10 Sep 17:28
e2f4e54

Choose a tag to compare

arbitrary-int 2.0.0

Added

  • New types for signed integers: i1, ..., i127.
  • The old Number trait is now replaced with three traits: UnsignedInteger (equivalent to the old Number), SignedInteger and Integer (which can be either signed or unsigned).
  • prelude: use arbitrary-int::prelude::* to get everything (except for the deprecated Number trait).
  • Various new extract functions: extract_i8, extract_i16, ..., extract_i128. These are the same as the equivalent extract_u functions, but work with signed integers instead.
  • Add quickcheck and arbitrary support
  • Support core::iter::Sum: [u7::new(1); 10].iter().sum::() == u7::new(10)
  • Support core::iter::Product: [i7::new(2); 4].iter().product::() == i7::new(16)
  • Integer, SignedInteger and UnsignedInteger now themselves implement various numeric traits such as Add, BitAnd etc. This both helps simplify the code but allows client code to operate on regular and arbitrary integers in a more generic way.

Fixed

  • leading_zeros and trailing_zeros now report the correct number of bits when a value of MIN is passed.
  • The implementation of BorshSerialize and BorshDeserialize now correctly handle writers/readers that can only partially write/read all data after a single call to borsh::io::Write::write()/borsh::io::Read::read(). This can happen if for example an TcpStream is waiting on the other end to send more data. The value would previously be truncated, now it blocks until enough data is available.

1.2.0

23 Aug 20:14

Choose a tag to compare

Many functions are now #[inline], which should give better (and more predictable) performance

1.1.0

10 Aug 21:15

Choose a tag to compare

Update version number

1.0.0

03 Aug 22:40

Choose a tag to compare

First version that was uploaded to crates.io