Skip to content

Commit

Permalink
Merge #108
Browse files Browse the repository at this point in the history
108: Release 0.2.3 r=cuviper a=cuviper



Co-authored-by: Josh Stone <cuviper@gmail.com>
  • Loading branch information
bors[bot] and cuviper authored Sep 4, 2019
2 parents a473fe3 + e86e14b commit 7417458
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories = [ "algorithms", "data-structures", "science" ]
license = "MIT/Apache-2.0"
name = "num-bigint"
repository = "https://github.com/rust-num/num-bigint"
version = "0.2.2"
version = "0.2.3"
readme = "README.md"
build = "build.rs"

Expand Down
13 changes: 13 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Release 0.2.3 (2019-09-03)

- [`Pow` is now implemented for `BigUint` exponents][77].
- [The optional `quickcheck` feature enables implementations of `Arbitrary`][99].
- See the [full comparison][compare-0.2.3] for performance enhancements and more!

[77]: https://github.com/rust-num/num-bigint/pull/77
[99]: https://github.com/rust-num/num-bigint/pull/99
[compare-0.2.3]: https://github.com/rust-num/num-bigint/compare/num-bigint-0.2.2...num-bigint-0.2.3

**Contributors**: @cuviper, @lcnr, @maxbla, @mikelodder7, @mikong,
@TheLetterTheta, @tspiteri, @XAMPPRocky, @youknowone

# Release 0.2.2 (2018-12-14)

- [The `Roots` implementations now use better initial guesses][71].
Expand Down
8 changes: 4 additions & 4 deletions benches/shootout-pidigits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ fn pidigits(n: isize, out: &mut dyn io::Write) -> io::Result<()> {
}
}

try!(write!(out, "{}", d));
write!(out, "{}", d)?;
if i % 10 == 0 {
try!(write!(out, "\t:{}\n", i));
write!(out, "\t:{}\n", i)?;
}

context.eliminate_digit(d);
Expand All @@ -120,9 +120,9 @@ fn pidigits(n: isize, out: &mut dyn io::Write) -> io::Result<()> {
let m = n % 10;
if m != 0 {
for _ in m..10 {
try!(write!(out, " "));
write!(out, " ")?;
}
try!(write!(out, "\t:{}\n", n));
write!(out, "\t:{}\n", n)?;
}
Ok(())
}
Expand Down
3 changes: 2 additions & 1 deletion src/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ impl Arbitrary for BigInt {
Self::from_biguint(sign, BigUint::arbitrary(g))
}

#[allow(bare_trait_objects)] // `dyn` needs Rust 1.27 to parse, even when cfg-disabled
fn shrink(&self) -> Box<Iterator<Item = Self>> {
let sign = self.sign();
let unsigned_shrink = self.data.shrink();
Expand Down Expand Up @@ -694,7 +695,7 @@ impl Num for BigInt {
} else {
Plus
};
let bu = try!(BigUint::from_str_radix(s, radix));
let bu = BigUint::from_str_radix(s, radix)?;
Ok(BigInt::from_biguint(sign, bu))
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/biguint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl Arbitrary for BigUint {
Self::new(Vec::<u32>::arbitrary(g))
}

#[allow(bare_trait_objects)] // `dyn` needs Rust 1.27 to parse, even when cfg-disabled
fn shrink(&self) -> Box<Iterator<Item = Self>> {
// Use shrinker from Vec
Box::new(self.data.shrink().map(|x| BigUint::new(x)))
Expand Down Expand Up @@ -2424,7 +2425,7 @@ impl<'de> serde::Deserialize<'de> for BigUint {
where
D: serde::Deserializer<'de>,
{
let data: Vec<u32> = try!(Vec::deserialize(deserializer));
let data: Vec<u32> = Vec::deserialize(deserializer)?;
Ok(BigUint::new(data))
}
}
Expand Down

0 comments on commit 7417458

Please sign in to comment.