Skip to content

Commit 584f6f4

Browse files
bors[bot]cuviper
andcommitted
Merge #7
7: impl Integer for i128 and u128 r=cuviper a=cuviper Co-authored-by: Josh Stone <[email protected]>
2 parents a582e9a + 16cbd05 commit 584f6f4

File tree

7 files changed

+28
-4
lines changed

7 files changed

+28
-4
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: rust
22
rust:
33
- 1.8.0
4+
- 1.15.0
5+
- 1.20.0
46
- stable
57
- beta
68
- nightly

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ categories = ["algorithms", "science", "no-std"]
88
license = "MIT/Apache-2.0"
99
repository = "https://github.com/rust-num/num-integer"
1010
name = "num-integer"
11-
version = "0.1.36"
11+
version = "0.1.37"
1212
readme = "README.md"
1313

1414
[package.metadata.docs.rs]
1515
all-features = true
1616

1717
[dependencies.num-traits]
18-
version = "0.2.0"
18+
version = "0.2.3"
1919
default-features = false
2020

2121
[features]
2222
default = ["std"]
23-
std = []
23+
i128 = ["num-traits/i128"]
24+
std = ["num-traits/std"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ default-features = false
3636
There is no functional difference with and without `std` at this time, but
3737
there may be in the future.
3838

39+
Implementations for `i128` and `u128` are only available when `i128` is enabled.
40+
3941
## Releases
4042

4143
Release notes are available in [RELEASES.md](RELEASES.md).

RELEASES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Release 0.1.37
2+
3+
- [`Integer` is now implemented for `i128` and `u128`][7] starting with Rust
4+
1.26, enabled by the new `i128` crate feature.
5+
6+
**Contributors**: @cuviper
7+
8+
[7]: https://github.com/rust-num/num-integer/pull/7
9+
110
# Release 0.1.36
211

312
- [num-integer now has its own source repository][num-356] at [rust-num/num-integer][home].

ci/rustup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set -ex
66

77
export TRAVIS_RUST_VERSION
8-
for TRAVIS_RUST_VERSION in 1.8.0 stable beta nightly; do
8+
for TRAVIS_RUST_VERSION in 1.8.0 1.15.0 1.20.0 stable beta nightly; do
99
run="rustup run $TRAVIS_RUST_VERSION"
1010
$run cargo build --verbose
1111
$run $PWD/ci/test_full.sh

ci/test_full.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ cargo test --verbose
1111
# test `no_std`
1212
cargo build --verbose --no-default-features
1313
cargo test --verbose --no-default-features
14+
15+
# test `i128`
16+
if [[ "$TRAVIS_RUST_VERSION" =~ ^(nightly|beta|stable)$ ]]; then
17+
cargo build --verbose --features=i128
18+
cargo test --verbose --features=i128
19+
fi

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ impl_integer_for_isize!(i16, test_integer_i16);
503503
impl_integer_for_isize!(i32, test_integer_i32);
504504
impl_integer_for_isize!(i64, test_integer_i64);
505505
impl_integer_for_isize!(isize, test_integer_isize);
506+
#[cfg(feature = "i128")]
507+
impl_integer_for_isize!(i128, test_integer_i128);
506508

507509
macro_rules! impl_integer_for_usize {
508510
($T:ty, $test_mod:ident) => (
@@ -675,6 +677,8 @@ impl_integer_for_usize!(u16, test_integer_u16);
675677
impl_integer_for_usize!(u32, test_integer_u32);
676678
impl_integer_for_usize!(u64, test_integer_u64);
677679
impl_integer_for_usize!(usize, test_integer_usize);
680+
#[cfg(feature = "i128")]
681+
impl_integer_for_usize!(u128, test_integer_u128);
678682

679683
/// An iterator over binomial coefficients.
680684
pub struct IterBinomial<T> {

0 commit comments

Comments
 (0)