This commit is contained in:
bluss
2021-03-29 22:05:34 +02:00
parent b0dfc877c1
commit 5685049fbe
5 changed files with 12 additions and 15 deletions
+9
View File
@@ -1,6 +1,15 @@
Recent Changes (arrayvec) Recent Changes (arrayvec)
========================= =========================
## 0.7.0
- `fn new_const` is now the way to const-construct arrayvec and arraystring,
and `fn new` has been reverted to a regular "non-const" function.
This works around performance issue #182, where the const fn version did not
optimize well. Change by @bluss with thanks to @rodrimati1992 and @niklasf
for analyzing the problem.
- The deprecated feature flag `unstable-const-fn` was removed, since it's not needed
## 0.6.1 ## 0.6.1
- The ``ArrayVec::new`` and ``ArrayString::new`` constructors are properly - The ``ArrayVec::new`` and ``ArrayString::new`` constructors are properly
+1 -2
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "arrayvec" name = "arrayvec"
version = "0.6.1" version = "0.7.0"
authors = ["bluss"] authors = ["bluss"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2018" edition = "2018"
@@ -37,7 +37,6 @@ harness = false
[features] [features]
default = ["std"] default = ["std"]
std = [] std = []
unstable-const-fn = []
[profile.bench] [profile.bench]
debug = true debug = true
+1 -4
View File
@@ -73,10 +73,7 @@ impl<const CAP: usize> ArrayString<CAP>
/// ``` /// ```
/// use arrayvec::ArrayString; /// use arrayvec::ArrayString;
/// ///
/// let mut string = ArrayString::<16>::new(); /// static ARRAY: ArrayString<1024> = ArrayString::new_const();
/// string.push_str("foo");
/// assert_eq!(&string[..], "foo");
/// assert_eq!(string.capacity(), 16);
/// ``` /// ```
pub const fn new_const() -> ArrayString<CAP> { pub const fn new_const() -> ArrayString<CAP> {
assert_capacity_limit_const!(CAP); assert_capacity_limit_const!(CAP);
+1 -5
View File
@@ -91,11 +91,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
/// ``` /// ```
/// use arrayvec::ArrayVec; /// use arrayvec::ArrayVec;
/// ///
/// let mut array = ArrayVec::<_, 16>::new(); /// static ARRAY: ArrayVec<u8, 1024> = ArrayVec::new_const();
/// array.push(1);
/// array.push(2);
/// assert_eq!(&array[..], &[1, 2]);
/// assert_eq!(array.capacity(), 16);
/// ``` /// ```
pub const fn new_const() -> ArrayVec<T, CAP> { pub const fn new_const() -> ArrayVec<T, CAP> {
assert_capacity_limit_const!(CAP); assert_capacity_limit_const!(CAP);
-4
View File
@@ -11,10 +11,6 @@
//! - Optional //! - Optional
//! - Enable serialization for ArrayVec and ArrayString using serde 1.x //! - Enable serialization for ArrayVec and ArrayString using serde 1.x
//! //!
//! - `unstable-const-fn`
//! - **deprecated** (has no effect)
//! - Not needed, [`ArrayVec::new`] and [`ArrayString::new`] are always `const fn` now
//!
//! ## Rust Version //! ## Rust Version
//! //!
//! This version of arrayvec requires Rust 1.51 or later. //! This version of arrayvec requires Rust 1.51 or later.