Skip to content

Commit 8ca9559

Browse files
authored
Merge pull request #138 from fizyk20/1.0
1.0
2 parents de862b5 + 7e53053 commit 8ca9559

25 files changed

+1910
-1580
lines changed

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
* **`1.0.0`**
2+
* **Use GATs for `ArrayLength`** !
3+
* Bump MSRV to 1.65.0
4+
* Use Rust 2021 edition [#118](https://github.com/fizyk20/generic-array/pull/118) + non-PR upgrade later with GATs.
5+
* Allow `arr!` macro in `const` [#129](https://github.com/fizyk20/generic-array/pull/129)
6+
* Add `arr!` repeat-expressions [#130](https://github.com/fizyk20/generic-array/pull/130)
7+
* Implement `const-default` trait support [#131](https://github.com/fizyk20/generic-array/pull/131)
8+
* Make `as_slice()/from_slice()` const.
9+
* Add const `from_array`/`into_array` methods.
10+
* Make `ArrayLength: 'static`
11+
* Replace `From<&[T]>` with `TryFrom<&[T]>`
12+
* Add `try_from_iter` for fallible construction from iterator.
13+
* Use `typenum`'s `const-generics` feature for `const N: usize`-based `From` implementations between `[T; N]` and `GenericArray<T, N>`
14+
* Also added the `IntoArrayLength` trait and `ConstArrayLength` type-alias for working with typenum's `Const<N>` easier.
15+
* `alloc` crate feature
16+
* Added `box_arr!` macro with the same syntax as `arr!`, but returns a `Box<GenericArray<T, N>>`
17+
* Moving between heap and stack
18+
* `impl TryFrom<Vec<T>> for GenericArray<T, N>`
19+
* `impl TryFrom<Box<[T]>> for GenericArray<T, N>`
20+
* `impl From<GenericArray<T, N>> for Vec<T>`
21+
* `impl From<GenericArray<T, N>> for Box<[T]>`
22+
* Methods for converting between `Box<GenericArray<T, N>>` and `Vec<T>`/`Box<[T]>`
23+
* `GenericSequence` and `FunctionalSequence` implemented for `Box<GenericArray<T, N>>`, allowing for heap-based manipulation of fixed-size arrays.
24+
* `Deserialize` no longer requires `T: Default`
25+
* Make `IntoArrayLength`, `MappedSequence`, and `FunctionalSequence` safe traits.
26+
* Simplify `arr!` macro syntax.
27+
* `arr![1, 2, 3, 4]` or `arr![T; N]` forms, no explicit length for first variant.
28+
* No longer casts given expressions internally.
29+
* Type-deduction works similarly to `vec![]`, in that an empty array has an unknown type
30+
* Add the `internals` Cargo feature to expose dangerous things.
31+
* Added additional methods for working with chunks of arrays.
32+
* Added `From` impls for tuples with 1-12 (inclusive) items of the same type, matching the standard library.
33+
* Workaround potential Rust/LLVM regressions with `FunctionalSequence::zip()`/`::map()`
34+
* Improve documentation
35+
136
* **`0.14.6`**
237
* Add an optional `Zeroize` impl for `GenericArray` ([#126](https://github.com/fizyk20/generic-array/pull/126) and [#112](https://github.com/fizyk20/generic-array/pull/112))
338
* Cleanup some unsafe ([#125](https://github.com/fizyk20/generic-array/pull/125)) and typos ([#114](https://github.com/fizyk20/generic-array/pull/114))

Cargo.toml

+25-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22

33
name = "generic-array"
4-
version = "0.14.6"
5-
authors = [ "Bartłomiej Kamiński <[email protected]>", "Aaron Trent <[email protected]>" ]
6-
edition = "2018"
4+
version = "1.0.0"
5+
authors = ["Bartłomiej Kamiński <[email protected]>", "Aaron Trent <[email protected]>"]
6+
edition = "2021"
77

88
description = "Generic types implementing functionality of arrays"
99
readme = "README.md"
@@ -15,7 +15,7 @@ repository = "https://github.com/fizyk20/generic-array.git"
1515

1616
keywords = ["generic", "array"]
1717
categories = ["data-structures", "no-std"]
18-
include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md", "build.rs"]
18+
include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
1919

2020
[badges]
2121
travis-ci = { repository = "fizyk20/generic-array" }
@@ -24,21 +24,36 @@ travis-ci = { repository = "fizyk20/generic-array" }
2424
name = "generic_array"
2525

2626
[features]
27-
more_lengths = []
27+
alloc = []
28+
internals = []
2829

2930
[dependencies]
30-
typenum = "1.12"
31+
typenum = { version = "1.16", features = ["const-generics"] }
3132
const-default = { version = "1", optional = true, default-features = false }
3233
serde = { version = "1.0", optional = true, default-features = false }
3334
zeroize = { version = "1", optional = true, default-features = false }
35+
faster-hex = { version = "0.8", optional = true, default-features = false }
3436

35-
[dev_dependencies]
37+
[dev-dependencies]
3638
# this can't yet be made optional, see https://github.com/rust-lang/cargo/issues/1596
3739
serde_json = "1.0"
3840
bincode = "1.0"
41+
criterion = { version = "0.5", features = ["html_reports"] }
42+
rand = "0.8"
3943

40-
[build_dependencies]
41-
version_check = "0.9"
44+
[[bench]]
45+
name = "hex"
46+
harness = false
47+
48+
[profile.bench]
49+
opt-level = 3
50+
lto = 'fat'
51+
codegen-units = 1
4252

4353
[package.metadata.docs.rs]
44-
features = ["serde", "zeroize"]
54+
# all but "internals", don't show those on docs.rs
55+
features = ["serde", "zeroize", "const-default", "alloc"]
56+
rustdoc-args = ["--cfg", "docsrs"]
57+
58+
[package.metadata.playground]
59+
all-features = true

0 commit comments

Comments
 (0)