Skip to content

Commit 7c8268d

Browse files
committed
impl Integer for i128 and u128
1 parent a582e9a commit 7c8268d

File tree

6 files changed

+18
-3
lines changed

6 files changed

+18
-3
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ readme = "README.md"
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).

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)