Skip to content

Commit 5685049

Browse files
committed
0.7.0
1 parent b0dfc87 commit 5685049

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Recent Changes (arrayvec)
22
=========================
33

4+
## 0.7.0
5+
6+
- `fn new_const` is now the way to const-construct arrayvec and arraystring,
7+
and `fn new` has been reverted to a regular "non-const" function.
8+
This works around performance issue #182, where the const fn version did not
9+
optimize well. Change by @bluss with thanks to @rodrimati1992 and @niklasf
10+
for analyzing the problem.
11+
- The deprecated feature flag `unstable-const-fn` was removed, since it's not needed
12+
413
## 0.6.1
514

615
- The ``ArrayVec::new`` and ``ArrayString::new`` constructors are properly

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "arrayvec"
3-
version = "0.6.1"
3+
version = "0.7.0"
44
authors = ["bluss"]
55
license = "MIT OR Apache-2.0"
66
edition = "2018"
@@ -37,7 +37,6 @@ harness = false
3737
[features]
3838
default = ["std"]
3939
std = []
40-
unstable-const-fn = []
4140

4241
[profile.bench]
4342
debug = true

src/array_string.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ impl<const CAP: usize> ArrayString<CAP>
7373
/// ```
7474
/// use arrayvec::ArrayString;
7575
///
76-
/// let mut string = ArrayString::<16>::new();
77-
/// string.push_str("foo");
78-
/// assert_eq!(&string[..], "foo");
79-
/// assert_eq!(string.capacity(), 16);
76+
/// static ARRAY: ArrayString<1024> = ArrayString::new_const();
8077
/// ```
8178
pub const fn new_const() -> ArrayString<CAP> {
8279
assert_capacity_limit_const!(CAP);

src/arrayvec.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
9191
/// ```
9292
/// use arrayvec::ArrayVec;
9393
///
94-
/// let mut array = ArrayVec::<_, 16>::new();
95-
/// array.push(1);
96-
/// array.push(2);
97-
/// assert_eq!(&array[..], &[1, 2]);
98-
/// assert_eq!(array.capacity(), 16);
94+
/// static ARRAY: ArrayVec<u8, 1024> = ArrayVec::new_const();
9995
/// ```
10096
pub const fn new_const() -> ArrayVec<T, CAP> {
10197
assert_capacity_limit_const!(CAP);

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
//! - Optional
1212
//! - Enable serialization for ArrayVec and ArrayString using serde 1.x
1313
//!
14-
//! - `unstable-const-fn`
15-
//! - **deprecated** (has no effect)
16-
//! - Not needed, [`ArrayVec::new`] and [`ArrayString::new`] are always `const fn` now
17-
//!
1814
//! ## Rust Version
1915
//!
2016
//! This version of arrayvec requires Rust 1.51 or later.

0 commit comments

Comments
 (0)