1 Recent Changes (arrayvec)
2 =========================
6 - Add new ArrayVec methods `.take()` and `.into_inner_unchecked()` by @conradludgate
7 - `clone_from` now uses `truncate` when needed by @a1phyr
11 - `fn new_const` is now the way to const-construct arrayvec and arraystring,
12 and `fn new` has been reverted to a regular "non-const" function.
13 This works around performance issue #182, where the const fn version did not
14 optimize well. Change by @bluss with thanks to @rodrimati1992 and @niklasf
15 for analyzing the problem.
17 - The deprecated feature flag `unstable-const-fn` was removed, since it's not needed
19 - Optimize `.retain()` by using the same algorithm as in std, change by @niklasf,
20 issue #174. Original optimization in Rust std by @oxalica in rust-lang/rust/pull/81126
24 - The ``ArrayVec::new`` and ``ArrayString::new`` constructors are properly
25 const fns on stable and the feature flag ``unstable-const-fn`` is now deprecated.
28 - Small fix to the capacity check macro by @Xaeroxe
29 - Typo fix in documentation by @cuviper
30 - Small code cleanup by @bluss
34 - The **const generics** release 🎉. Arrayvec finally implements what it
35 wanted to implement, since its first version: a vector backed by an array,
36 with generic parameters for the arbitrary element type *and* backing array
39 The New type syntax is `ArrayVec<T, CAP>` where `CAP` is the arrayvec capacity.
40 For arraystring the syntax is `ArrayString<CAP>`.
42 Length is stored internally as u32; this limits the maximum capacity. The size
43 of the `ArrayVec` or `ArrayString` structs for the same capacity may grow
44 slightly compared with the previous version (depending on padding requirements
45 for the element type). Change by @bluss.
47 - Arrayvec's `.extend()` and `FromIterator`/`.collect()` to arrayvec now
48 **panic** if the capacity of the arrayvec is exceeded. Change by @bluss.
50 - Arraystring now implements `TryFrom<&str>` and `TryFrom<fmt::Arguments>` by
53 - Minimum supported rust version is Rust 1.51
57 - Add `is_empty` methods for ArrayVec and ArrayString by @nicbn
58 - Implement `TryFrom<Slice>` for ArrayVec by @paulkernfeld
59 - Add `unstable-const-fn` to make `new` methods const by @m-ou-se
60 - Run miri in CI and a few related fixes by @RalfJung
61 - Fix outdated comment by @Phlosioneer
62 - Move changelog to a separate file by @Luro02
63 - Remove deprecated `Error::description` by @AnderEnder
64 - Use pointer method `add` by @hbina
68 - Add `as_ptr`, `as_mut_ptr` accessors directly on the `ArrayVec` by @tbu-
69 (matches the same addition to `Vec` which happened in Rust 1.37).
70 - Add method `ArrayString::len` (now available directly, not just through deref to str).
71 - Use raw pointers instead of `&mut [u8]` for encoding chars into `ArrayString`
72 (uninit best practice fix).
73 - Use raw pointers instead of `get_unchecked_mut` where the target may be
74 uninitialized everywhere relevant in the ArrayVec implementation
75 (uninit best practice fix).
76 - Changed inline hints on many methods, mainly removing inline hints
77 - `ArrayVec::dispose` is now deprecated (it has no purpose anymore)
81 - Use raw pointers instead of `get_unchecked_mut` where the target may be
82 uninitialized everywhere relevant in the ArrayVec implementation.
86 - Use `MaybeUninit` (now unconditionally) in the implementation of
88 - Use `MaybeUninit` (now unconditionally) in the implementation of
90 - The crate feature for serde serialization is now named `serde`.
91 - Updated the `Array` trait interface, and it is now easier to use for
92 users outside the crate.
93 - Add `FromStr` impl for `ArrayString` by @despawnerer
94 - Add method `try_extend_from_slice` to `ArrayVec`, which is always
95 effecient by @Thomasdezeeuw.
96 - Add method `remaining_capacity` by @Thomasdezeeuw
97 - Improve performance of the `extend` method.
98 - The index type of zero capacity vectors is now itself zero size, by
100 - Use `drop_in_place` for truncate and clear methods. This affects drop order
101 and resume from panic during drop.
102 - Use Rust 2018 edition for the implementation
103 - Require Rust 1.36 or later, for the unconditional `MaybeUninit`
110 - In Rust 1.36 or later, use newly stable `MaybeUninit`. This extends the
111 soundness work introduced in 0.4.9, we are finally able to use this in
112 stable. We use feature detection (build script) to enable this at build
117 - Use `repr(C)` in the `union` version that was introduced in 0.4.9, to
118 allay some soundness concerns.
122 - Use `union` in the implementation on when this is detected to be supported
123 (nightly only for now). This is a better solution for treating uninitialized
124 regions correctly, and we'll use it in stable Rust as soon as we are able.
125 When this is enabled, the `ArrayVec` has no space overhead in its memory
126 layout, although the size of the vec should not be relied upon. (See [#114](https://github.com/bluss/arrayvec/pull/114))
127 - `ArrayString` updated to not use uninitialized memory, it instead zeros its
128 backing array. This will be refined in the next version, since we
129 need to make changes to the user visible API.
130 - The `use_union` feature now does nothing (like its documentation foretold).
135 - Implement Clone and Debug for `IntoIter` by @clarcharr
136 - Add more array sizes under crate features. These cover all in the range
137 up to 128 and 129 to 255 respectively (we have a few of those by default):
139 - `array-size-33-128`
140 - `array-size-129-255`
144 - Fix future compat warning about raw pointer casts
145 - Use `drop_in_place` when dropping the arrayvec by-value iterator
146 - Decrease mininum Rust version (see docs) by @jeehoonkang
150 - Fix future compat warning about raw pointer casts
154 - Fix compilation on 16-bit targets. This means, the 65536 array size is not
155 included on these targets.
159 - Fix compilation on 16-bit targets. This means, the 65536 array size is not
160 included on these targets.
161 - Fix license files so that they are both included (was fixed in 0.4 before)
165 - Add methods to `ArrayString` by @DenialAdams:
167 - `.pop() -> Option<char>`
168 - `.truncate(new_len)`
169 - `.remove(index) -> char`
171 - Remove dependency on crate odds
172 - Document debug assertions in unsafe methods better
176 - Add method `ArrayVec::truncate()` by @niklasf
180 - Improve performance for `ArrayVec::extend` with a lower level
182 - Small cleanup in dependencies (use no std for crates where we don't need more)
186 - Add constructor method `new` to `CapacityError`.
190 - Add `Default` impl to `ArrayString` by @tbu-
194 - Reformed signatures and error handling by @bluss and @tbu-:
196 - `ArrayVec`'s `push, insert, remove, swap_remove` now match `Vec`'s
197 corresponding signature and panic on capacity errors where applicable.
198 - Add fallible methods `try_push, insert` and checked methods
200 - Similar changes to `ArrayString`'s push methods.
202 - Use a local version of the `RangeArgument` trait
203 - Add array sizes 50, 150, 200 by @daboross
204 - Support serde 1.0 by @daboross
205 - New method `.push_unchecked()` by @niklasf
206 - `ArrayString` implements `PartialOrd, Ord` by @tbu-
208 - crate feature `use_generic_array` was dropped.
212 - Implement `PartialOrd, Ord` as well as `PartialOrd<str>` for
217 - Implement `Array` for the 65536 size
221 - Use `encode_utf8` from crate odds
222 - Add constructor `ArrayString::from_byte_string`
226 - Simplify and speed up `ArrayString`’s `.push(char)`-
230 - Add new crate feature `use_generic_array` which allows using their
231 `GenericArray` just like a regular fixed size array for the storage
236 - Fix bounds check in `ArrayVec::insert`!
237 It would be buggy if `self.len() < index < self.capacity()`. Take note of
238 the push out behavior specified in the docs.
242 - Added crate feature `use_union` which forwards to the nodrop crate feature
243 - Added methods `.is_full()` to `ArrayVec` and `ArrayString`.
247 - Added method `.retain()` to `ArrayVec`.
248 - Added methods `.as_slice(), .as_mut_slice()` to `ArrayVec` and `.as_str()`
253 - Add feature std, which you can opt out of to use `no_std` (requires Rust 1.6
255 - Implement `Clone::clone_from` for ArrayVec and ArrayString
259 - Add `ArrayString::from(&str)`
263 - Added `DerefMut` impl for `ArrayString`.
264 - Added method `.simplify()` to drop the element for `CapacityError`.
265 - Added method `.dispose()` to `ArrayVec`
269 - Added ArrayString, a fixed capacity analogy of String
273 - Added trait impls Default, PartialOrd, Ord, Write for ArrayVec
277 - Go back to using external NoDrop, fixing a panic safety bug (issue #3)
281 - Inline the non-dropping logic to remove one drop flag in the
282 ArrayVec representation.
286 - Added method .into_inner()
287 - Added unsafe method .set_len()