Skip to content

Commit 2ad63fb

Browse files
bors[bot]cuviper
andauthored
Merge #81
81: Release 0.3.0 r=cuviper a=cuviper Co-authored-by: Josh Stone <cuviper@gmail.com>
2 parents 7d5d3f0 + 34a1ac4 commit 2ad63fb

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

RELEASES.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
# Release 0.3.0 (2020-06-13)
2+
3+
### Enhancements
4+
5+
- [`Ratio` now implements `ToPrimitive`][52].
6+
- [`Ratio` now implements additional formatting traits][56]:
7+
- `Binary`, `Octal`, `LowerHex`, `UpperHex`, `LowerExp`, `UpperExp`
8+
- [The `Pow` implementations have been expanded][70].
9+
- `Pow<BigInt>` and `Pow<BigUint>` are now implemented.
10+
- `Pow<_> for &Ratio<T>` now uses `&T: Pow`.
11+
- The inherent `pow` method now uses `&T: Pow`.
12+
13+
### Breaking Changes
14+
15+
- [`num-rational` now requires Rust 1.31 or greater][66].
16+
- The "i128" opt-in feature was removed, now always available.
17+
- [The "num-bigint-std" feature replaces "bigint" with `std` enabled][80].
18+
- The "num-bigint" feature without `std` uses `alloc` on Rust 1.36+.
19+
20+
**Contributors**: @cuviper, @MattX, @maxbla
21+
22+
[52]: https://github.com/rust-num/num-rational/pull/52
23+
[56]: https://github.com/rust-num/num-rational/pull/56
24+
[66]: https://github.com/rust-num/num-rational/pull/66
25+
[70]: https://github.com/rust-num/num-rational/pull/70
26+
[80]: https://github.com/rust-num/num-rational/pull/80
27+
128
# Release 0.2.4 (2020-03-17)
229

330
- [Fixed `CheckedDiv` when both dividend and divisor are 0][74].

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ macro_rules! impl_formatting {
10061006
($fmt_trait:ident, $prefix:expr, $fmt_str:expr, $fmt_alt:expr) => {
10071007
impl<T: $fmt_trait + Clone + Integer> $fmt_trait for Ratio<T> {
10081008
#[cfg(feature = "std")]
1009-
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
1009+
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
10101010
let pre_pad = if self.denom.is_one() {
10111011
format!($fmt_str, self.numer)
10121012
} else {
@@ -1027,7 +1027,7 @@ macro_rules! impl_formatting {
10271027
f.pad_integral(non_negative, $prefix, pre_pad)
10281028
}
10291029
#[cfg(not(feature = "std"))]
1030-
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
1030+
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
10311031
let plus = if f.sign_plus() && self.numer >= T::zero() {
10321032
"+"
10331033
} else {

0 commit comments

Comments
 (0)