From 49179ad844af0791db6308fc92c0d4fcde82b7d5 Mon Sep 17 00:00:00 2001 From: novacrazy Date: Mon, 8 Jul 2019 13:36:33 -0500 Subject: [PATCH 1/5] Implement more to/from array lengths --- src/impls.rs | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/src/impls.rs b/src/impls.rs index 50a6413d93..f7dbc333fd 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -175,5 +175,55 @@ impl_from! { 29 => ::typenum::U29, 30 => ::typenum::U30, 31 => ::typenum::U31, - 32 => ::typenum::U32 + 32 => ::typenum::U32, + + 33 => ::typenum::U33, + 34 => ::typenum::U34, + 35 => ::typenum::U35, + 36 => ::typenum::U36, + 37 => ::typenum::U37, + 38 => ::typenum::U38, + 39 => ::typenum::U39, + 40 => ::typenum::U40, + 41 => ::typenum::U41, + 42 => ::typenum::U42, + 43 => ::typenum::U43, + 44 => ::typenum::U44, + 45 => ::typenum::U45, + 46 => ::typenum::U46, + 47 => ::typenum::U47, + 48 => ::typenum::U48, + 49 => ::typenum::U49, + 50 => ::typenum::U50, + 51 => ::typenum::U51, + 52 => ::typenum::U52, + 53 => ::typenum::U53, + 54 => ::typenum::U54, + 55 => ::typenum::U55, + 56 => ::typenum::U56, + 57 => ::typenum::U57, + 58 => ::typenum::U58, + 59 => ::typenum::U59, + 60 => ::typenum::U60, + 61 => ::typenum::U61, + 62 => ::typenum::U62, + 63 => ::typenum::U63, + 64 => ::typenum::U64, + + 70 => ::typenum::U70, + 80 => ::typenum::U80, + 90 => ::typenum::U90, + + 100 => ::typenum::U100, + 200 => ::typenum::U200, + 300 => ::typenum::U300, + 400 => ::typenum::U400, + 500 => ::typenum::U500, + + 128 => ::typenum::U128, + 256 => ::typenum::U256, + 512 => ::typenum::U512, + + 1000 => ::typenum::U1000, + 1024 => ::typenum::U1024 } From 1820105f115ab18fa83223a66fd1fe0ca9435c39 Mon Sep 17 00:00:00 2001 From: novacrazy Date: Mon, 8 Jul 2019 13:43:07 -0500 Subject: [PATCH 2/5] Add `more_lengths` feature --- Cargo.toml | 3 +++ src/impls.rs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index aa2442d58a..093e455f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,9 @@ travis-ci = { repository = "fizyk20/generic-array" } [lib] name = "generic_array" +[features] +more_lengths = [] + [dependencies] typenum = "1.10" serde = { version = "1.0", optional = true, default-features = false } diff --git a/src/impls.rs b/src/impls.rs index f7dbc333fd..f3262e166e 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -175,8 +175,11 @@ impl_from! { 29 => ::typenum::U29, 30 => ::typenum::U30, 31 => ::typenum::U31, - 32 => ::typenum::U32, + 32 => ::typenum::U32 +} +#[cfg(feature = "more_lengths")] +impl_from! { 33 => ::typenum::U33, 34 => ::typenum::U34, 35 => ::typenum::U35, From e99431aabcc6e5b5c3e729dac6c5030abdb4b1f7 Mon Sep 17 00:00:00 2001 From: novacrazy Date: Mon, 8 Jul 2019 13:43:24 -0500 Subject: [PATCH 3/5] Test and document all features --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e7432fad1a..9dc8f2c845 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,12 @@ script: - cd $TRAVIS_BUILD_DIR - cargo build - cargo test - - cargo build --features serde - - cargo test --features serde + - cargo build --all-features + - cargo test --all-features after_success: |- [ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ] && - cargo doc && + cargo doc --all-features && echo "" > target/doc/index.html && sudo pip install ghp-import && ghp-import -n target/doc && From ae2147b853a2b94978a934ff516c8e31635e17a2 Mon Sep 17 00:00:00 2001 From: novacrazy Date: Mon, 8 Jul 2019 13:43:43 -0500 Subject: [PATCH 4/5] impl_serde module didn't need to be public --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0de6a5b7f7..6fc5c841cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,7 +51,7 @@ mod hex; mod impls; #[cfg(feature = "serde")] -pub mod impl_serde; +mod impl_serde; use core::iter::FromIterator; use core::marker::PhantomData; From 0b08cfc496c72e712dce40c1e6864310355ce552 Mon Sep 17 00:00:00 2001 From: novacrazy Date: Mon, 8 Jul 2019 13:44:02 -0500 Subject: [PATCH 5/5] Bump version --- CHANGELOG.md | 3 +++ Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa2c7969d0..06ed3d23ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* **`0.13.2`** + * Add feature `more_lengths`, which adds more `From`/`Into` implementations for arrays of various lengths. + * **`0.13.1`** * Mark `GenericArray` as `#[repr(transparent)]` * Implement `Into<[T; N]>` for `GenericArray` up to N=32 diff --git a/Cargo.toml b/Cargo.toml index 093e455f45..4231c13742 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "generic-array" -version = "0.13.1" +version = "0.13.2" authors = [ "Bartłomiej Kamiński ", "Aaron Trent " ] description = "Generic types implementing functionality of arrays"