Skip to content

Commit

Permalink
Merge pull request #138 from fizyk20/1.0
Browse files Browse the repository at this point in the history
1.0
  • Loading branch information
novacrazy committed Sep 13, 2023
2 parents de862b5 + 7e53053 commit 8ca9559
Show file tree
Hide file tree
Showing 25 changed files with 1,910 additions and 1,580 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,38 @@
* **`1.0.0`**
* **Use GATs for `ArrayLength`** !
* Bump MSRV to 1.65.0
* Use Rust 2021 edition [#118](https://github.com/fizyk20/generic-array/pull/118) + non-PR upgrade later with GATs.
* Allow `arr!` macro in `const` [#129](https://github.com/fizyk20/generic-array/pull/129)
* Add `arr!` repeat-expressions [#130](https://github.com/fizyk20/generic-array/pull/130)
* Implement `const-default` trait support [#131](https://github.com/fizyk20/generic-array/pull/131)
* Make `as_slice()/from_slice()` const.
* Add const `from_array`/`into_array` methods.
* Make `ArrayLength: 'static`
* Replace `From<&[T]>` with `TryFrom<&[T]>`
* Add `try_from_iter` for fallible construction from iterator.
* Use `typenum`'s `const-generics` feature for `const N: usize`-based `From` implementations between `[T; N]` and `GenericArray<T, N>`
* Also added the `IntoArrayLength` trait and `ConstArrayLength` type-alias for working with typenum's `Const<N>` easier.
* `alloc` crate feature
* Added `box_arr!` macro with the same syntax as `arr!`, but returns a `Box<GenericArray<T, N>>`
* Moving between heap and stack
* `impl TryFrom<Vec<T>> for GenericArray<T, N>`
* `impl TryFrom<Box<[T]>> for GenericArray<T, N>`
* `impl From<GenericArray<T, N>> for Vec<T>`
* `impl From<GenericArray<T, N>> for Box<[T]>`
* Methods for converting between `Box<GenericArray<T, N>>` and `Vec<T>`/`Box<[T]>`
* `GenericSequence` and `FunctionalSequence` implemented for `Box<GenericArray<T, N>>`, allowing for heap-based manipulation of fixed-size arrays.
* `Deserialize` no longer requires `T: Default`
* Make `IntoArrayLength`, `MappedSequence`, and `FunctionalSequence` safe traits.
* Simplify `arr!` macro syntax.
* `arr![1, 2, 3, 4]` or `arr![T; N]` forms, no explicit length for first variant.
* No longer casts given expressions internally.
* Type-deduction works similarly to `vec![]`, in that an empty array has an unknown type
* Add the `internals` Cargo feature to expose dangerous things.
* Added additional methods for working with chunks of arrays.
* Added `From` impls for tuples with 1-12 (inclusive) items of the same type, matching the standard library.
* Workaround potential Rust/LLVM regressions with `FunctionalSequence::zip()`/`::map()`
* Improve documentation

* **`0.14.6`**
* 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))
* Cleanup some unsafe ([#125](https://github.com/fizyk20/generic-array/pull/125)) and typos ([#114](https://github.com/fizyk20/generic-array/pull/114))
Expand Down
35 changes: 25 additions & 10 deletions Cargo.toml
@@ -1,9 +1,9 @@
[package]

name = "generic-array"
version = "0.14.6"
authors = [ "Bartłomiej Kamiński <fizyk20@gmail.com>", "Aaron Trent <novacrazy@gmail.com>" ]
edition = "2018"
version = "1.0.0"
authors = ["Bartłomiej Kamiński <fizyk20@gmail.com>", "Aaron Trent <novacrazy@gmail.com>"]
edition = "2021"

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

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

[badges]
travis-ci = { repository = "fizyk20/generic-array" }
Expand All @@ -24,21 +24,36 @@ travis-ci = { repository = "fizyk20/generic-array" }
name = "generic_array"

[features]
more_lengths = []
alloc = []
internals = []

[dependencies]
typenum = "1.12"
typenum = { version = "1.16", features = ["const-generics"] }
const-default = { version = "1", optional = true, default-features = false }
serde = { version = "1.0", optional = true, default-features = false }
zeroize = { version = "1", optional = true, default-features = false }
faster-hex = { version = "0.8", optional = true, default-features = false }

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

[build_dependencies]
version_check = "0.9"
[[bench]]
name = "hex"
harness = false

[profile.bench]
opt-level = 3
lto = 'fat'
codegen-units = 1

[package.metadata.docs.rs]
features = ["serde", "zeroize"]
# all but "internals", don't show those on docs.rs
features = ["serde", "zeroize", "const-default", "alloc"]
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.playground]
all-features = true

0 comments on commit 8ca9559

Please sign in to comment.