+234
| Recent Changes (arrayvec) | ||
| ------------------------- | ||
| - 0.5.2 | ||
| - Add `is_empty` methods for ArrayVec and ArrayString by @nicbn | ||
| - Implement `TryFrom<Slice>` for ArrayVec by @paulkernfeld | ||
| - Add `unstable-const-fn` to make `new` methods const by @m-ou-se | ||
| - Run miri in CI and a few related fixes by @RalfJung | ||
| - Fix outdated comment by @Phlosioneer | ||
| - Move changelog to a separate file by @Luro02 | ||
| - Remove deprecated `Error::description` by @AnderEnder | ||
| - Use pointer method `add` by @hbina | ||
| - 0.5.1 | ||
| - Add `as_ptr`, `as_mut_ptr` accessors directly on the `ArrayVec` by @tbu- | ||
| (matches the same addition to `Vec` which happened in Rust 1.37). | ||
| - Add method `ArrayString::len` (now available directly, not just through deref to str). | ||
| - Use raw pointers instead of `&mut [u8]` for encoding chars into `ArrayString` | ||
| (uninit best practice fix). | ||
| - Use raw pointers instead of `get_unchecked_mut` where the target may be | ||
| uninitialized everywhere relevant in the ArrayVec implementation | ||
| (uninit best practice fix). | ||
| - Changed inline hints on many methods, mainly removing inline hints | ||
| - `ArrayVec::dispose` is now deprecated (it has no purpose anymore) | ||
| - 0.4.12 | ||
| - Use raw pointers instead of `get_unchecked_mut` where the target may be | ||
| uninitialized everywhere relevant in the ArrayVec implementation. | ||
| - 0.5.0 | ||
| - Use `MaybeUninit` (now unconditionally) in the implementation of | ||
| `ArrayVec` | ||
| - Use `MaybeUninit` (now unconditionally) in the implementation of | ||
| `ArrayString` | ||
| - The crate feature for serde serialization is now named `serde`. | ||
| - Updated the `Array` trait interface, and it is now easier to use for | ||
| users outside the crate. | ||
| - Add `FromStr` impl for `ArrayString` by @despawnerer | ||
| - Add method `try_extend_from_slice` to `ArrayVec`, which is always | ||
| effecient by @Thomasdezeeuw. | ||
| - Add method `remaining_capacity` by @Thomasdezeeuw | ||
| - Improve performance of the `extend` method. | ||
| - The index type of zero capacity vectors is now itself zero size, by | ||
| @clarfon | ||
| - Use `drop_in_place` for truncate and clear methods. This affects drop order | ||
| and resume from panic during drop. | ||
| - Use Rust 2018 edition for the implementation | ||
| - Require Rust 1.36 or later, for the unconditional `MaybeUninit` | ||
| improvements. | ||
| - 0.4.11 | ||
| - In Rust 1.36 or later, use newly stable `MaybeUninit`. This extends the | ||
| soundness work introduced in 0.4.9, we are finally able to use this in | ||
| stable. We use feature detection (build script) to enable this at build | ||
| time. | ||
| - 0.4.10 | ||
| - Use `repr(C)` in the `union` version that was introduced in 0.4.9, to | ||
| allay some soundness concerns. | ||
| - 0.4.9 | ||
| - Use `union` in the implementation on when this is detected to be supported | ||
| (nightly only for now). This is a better solution for treating uninitialized | ||
| regions correctly, and we'll use it in stable Rust as soon as we are able. | ||
| When this is enabled, the `ArrayVec` has no space overhead in its memory | ||
| layout, although the size of the vec should not be relied upon. (See [#114](https://github.com/bluss/arrayvec/pull/114)) | ||
| - `ArrayString` updated to not use uninitialized memory, it instead zeros its | ||
| backing array. This will be refined in the next version, since we | ||
| need to make changes to the user visible API. | ||
| - The `use_union` feature now does nothing (like its documentation foretold). | ||
| - 0.4.8 | ||
| - Implement Clone and Debug for `IntoIter` by @clarcharr | ||
| - Add more array sizes under crate features. These cover all in the range | ||
| up to 128 and 129 to 255 respectively (we have a few of those by default): | ||
| - `array-size-33-128` | ||
| - `array-size-129-255` | ||
| - 0.4.7 | ||
| - Fix future compat warning about raw pointer casts | ||
| - Use `drop_in_place` when dropping the arrayvec by-value iterator | ||
| - Decrease mininum Rust version (see docs) by @jeehoonkang | ||
| - 0.3.25 | ||
| - Fix future compat warning about raw pointer casts | ||
| - 0.4.6 | ||
| - Fix compilation on 16-bit targets. This means, the 65536 array size is not | ||
| included on these targets. | ||
| - 0.3.24 | ||
| - Fix compilation on 16-bit targets. This means, the 65536 array size is not | ||
| included on these targets. | ||
| - Fix license files so that they are both included (was fixed in 0.4 before) | ||
| - 0.4.5 | ||
| - Add methods to `ArrayString` by @DenialAdams: | ||
| - `.pop() -> Option<char>` | ||
| - `.truncate(new_len)` | ||
| - `.remove(index) -> char` | ||
| - Remove dependency on crate odds | ||
| - Document debug assertions in unsafe methods better | ||
| - 0.4.4 | ||
| - Add method `ArrayVec::truncate()` by @niklasf | ||
| - 0.4.3 | ||
| - Improve performance for `ArrayVec::extend` with a lower level | ||
| implementation (#74) | ||
| - Small cleanup in dependencies (use no std for crates where we don't need more) | ||
| - 0.4.2 | ||
| - Add constructor method `new` to `CapacityError`. | ||
| - 0.4.1 | ||
| - Add `Default` impl to `ArrayString` by @tbu- | ||
| - 0.4.0 | ||
| - Reformed signatures and error handling by @bluss and @tbu-: | ||
| - `ArrayVec`'s `push, insert, remove, swap_remove` now match `Vec`'s | ||
| corresponding signature and panic on capacity errors where applicable. | ||
| - Add fallible methods `try_push, insert` and checked methods | ||
| `pop_at, swap_pop`. | ||
| - Similar changes to `ArrayString`'s push methods. | ||
| - Use a local version of the `RangeArgument` trait | ||
| - Add array sizes 50, 150, 200 by @daboross | ||
| - Support serde 1.0 by @daboross | ||
| - New method `.push_unchecked()` by @niklasf | ||
| - `ArrayString` implements `PartialOrd, Ord` by @tbu- | ||
| - Require Rust 1.14 | ||
| - crate feature `use_generic_array` was dropped. | ||
| - 0.3.23 | ||
| - Implement `PartialOrd, Ord` as well as `PartialOrd<str>` for | ||
| `ArrayString`. | ||
| - 0.3.22 | ||
| - Implement `Array` for the 65536 size | ||
| - 0.3.21 | ||
| - Use `encode_utf8` from crate odds | ||
| - Add constructor `ArrayString::from_byte_string` | ||
| - 0.3.20 | ||
| - Simplify and speed up `ArrayString`’s `.push(char)`- | ||
| - 0.3.19 | ||
| - Add new crate feature `use_generic_array` which allows using their | ||
| `GenericArray` just like a regular fixed size array for the storage | ||
| of an `ArrayVec`. | ||
| - 0.3.18 | ||
| - Fix bounds check in `ArrayVec::insert`! | ||
| It would be buggy if `self.len() < index < self.capacity()`. Take note of | ||
| the push out behavior specified in the docs. | ||
| - 0.3.17 | ||
| - Added crate feature `use_union` which forwards to the nodrop crate feature | ||
| - Added methods `.is_full()` to `ArrayVec` and `ArrayString`. | ||
| - 0.3.16 | ||
| - Added method `.retain()` to `ArrayVec`. | ||
| - Added methods `.as_slice(), .as_mut_slice()` to `ArrayVec` and `.as_str()` | ||
| to `ArrayString`. | ||
| - 0.3.15 | ||
| - Add feature std, which you can opt out of to use `no_std` (requires Rust 1.6 | ||
| to opt out). | ||
| - Implement `Clone::clone_from` for ArrayVec and ArrayString | ||
| - 0.3.14 | ||
| - Add `ArrayString::from(&str)` | ||
| - 0.3.13 | ||
| - Added `DerefMut` impl for `ArrayString`. | ||
| - Added method `.simplify()` to drop the element for `CapacityError`. | ||
| - Added method `.dispose()` to `ArrayVec` | ||
| - 0.3.12 | ||
| - Added ArrayString, a fixed capacity analogy of String | ||
| - 0.3.11 | ||
| - Added trait impls Default, PartialOrd, Ord, Write for ArrayVec | ||
| - 0.3.10 | ||
| - Go back to using external NoDrop, fixing a panic safety bug (issue #3) | ||
| - 0.3.8 | ||
| - Inline the non-dropping logic to remove one drop flag in the | ||
| ArrayVec representation. | ||
| - 0.3.7 | ||
| - Added method .into_inner() | ||
| - Added unsafe method .set_len() |
+15
| #!/usr/bin/env sh | ||
| set -ex | ||
| export CARGO_NET_RETRY=5 | ||
| export CARGO_NET_TIMEOUT=10 | ||
| MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) | ||
| echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" | ||
| rustup default "$MIRI_NIGHTLY" | ||
| rustup component add miri | ||
| cargo miri setup | ||
| cargo miri test |
+24
| arrayvec | ||
| ======== | ||
| [](https://crates.io/crates/arrayvec) | ||
| [](https://crates.io/crates/nodrop) | ||
| [](https://docs.rs/arrayvec) | ||
| [](https://travis-ci.org/bluss/arrayvec) | ||
| [](LICENSE-APACHE) | ||
| OR | ||
| [](LICENSE) | ||
| A vector with fixed capacity. | ||
| Please read the [`API documentation here`](https://docs.rs/arrayvec) | ||
| # License | ||
| Dual-licensed to be compatible with the Rust project. | ||
| Licensed under the Apache License, Version 2.0 | ||
| http://www.apache.org/licenses/LICENSE-2.0 or the MIT license | ||
| http://opensource.org/licenses/MIT, at your | ||
| option. This file may not be copied, modified, or distributed | ||
| except according to those terms. |
| { | ||
| "git": { | ||
| "sha1": "6905bdbb8a873c3e5c965833b56e494b26b1c816" | ||
| "sha1": "d336f8c5c54df87154deb59ffc5c0a91749069be" | ||
| } | ||
| } |
+5
-0
@@ -25,2 +25,7 @@ language: rust | ||
| - FEATURES='array-sizes-33-128 array-sizes-129-255' | ||
| - rust: nightly | ||
| env: | ||
| - FEATURES='unstable-const-fn' | ||
| - name: "miri" | ||
| script: sh ci/miri.sh | ||
| branches: | ||
@@ -27,0 +32,0 @@ only: |
+2
-1
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "arrayvec" | ||
| version = "0.5.1" | ||
| version = "0.5.2" | ||
| authors = ["bluss"] | ||
@@ -64,1 +64,2 @@ description = "A vector with fixed capacity, backed by an array (it can be stored on the stack too). Implements fixed capacity ArrayVec and ArrayString." | ||
| std = [] | ||
| unstable-const-fn = [] |
+19
-4
@@ -61,2 +61,3 @@ use std::borrow::Borrow; | ||
| /// ``` | ||
| #[cfg(not(feature="unstable-const-fn"))] | ||
| pub fn new() -> ArrayString<A> { | ||
@@ -66,3 +67,3 @@ unsafe { | ||
| xs: MaybeUninitCopy::uninitialized(), | ||
| len: Index::from(0), | ||
| len: Index::ZERO, | ||
| } | ||
@@ -72,2 +73,12 @@ } | ||
| #[cfg(feature="unstable-const-fn")] | ||
| pub const fn new() -> ArrayString<A> { | ||
| unsafe { | ||
| ArrayString { | ||
| xs: MaybeUninitCopy::uninitialized(), | ||
| len: Index::ZERO, | ||
| } | ||
| } | ||
| } | ||
| /// Return the length of the string. | ||
@@ -77,2 +88,6 @@ #[inline] | ||
| /// Returns whether the string is empty. | ||
| #[inline] | ||
| pub fn is_empty(&self) -> bool { self.len() == 0 } | ||
| /// Create a new `ArrayString` from a `str`. | ||
@@ -233,3 +248,3 @@ /// | ||
| unsafe { | ||
| let dst = self.xs.ptr_mut().offset(self.len() as isize); | ||
| let dst = self.xs.ptr_mut().add(self.len()); | ||
| let src = s.as_ptr(); | ||
@@ -325,4 +340,4 @@ ptr::copy_nonoverlapping(src, dst, s.len()); | ||
| unsafe { | ||
| ptr::copy(self.xs.ptr().offset(next as isize), | ||
| self.xs.ptr_mut().offset(idx as isize), | ||
| ptr::copy(self.xs.ptr().add(next), | ||
| self.xs.ptr_mut().add(idx), | ||
| len - next); | ||
@@ -329,0 +344,0 @@ self.set_len(len - (next - idx)); |
+7
-0
@@ -37,2 +37,3 @@ | ||
| pub trait Index : PartialEq + Copy { | ||
| const ZERO: Self; | ||
| fn to_usize(self) -> usize; | ||
@@ -43,2 +44,3 @@ fn from(_: usize) -> Self; | ||
| impl Index for () { | ||
| const ZERO: Self = (); | ||
| #[inline(always)] | ||
@@ -51,2 +53,3 @@ fn to_usize(self) -> usize { 0 } | ||
| impl Index for bool { | ||
| const ZERO: Self = false; | ||
| #[inline(always)] | ||
@@ -59,2 +62,3 @@ fn to_usize(self) -> usize { self as usize } | ||
| impl Index for u8 { | ||
| const ZERO: Self = 0; | ||
| #[inline(always)] | ||
@@ -67,2 +71,3 @@ fn to_usize(self) -> usize { self as usize } | ||
| impl Index for u16 { | ||
| const ZERO: Self = 0; | ||
| #[inline(always)] | ||
@@ -75,2 +80,3 @@ fn to_usize(self) -> usize { self as usize } | ||
| impl Index for u32 { | ||
| const ZERO: Self = 0; | ||
| #[inline(always)] | ||
@@ -83,2 +89,3 @@ fn to_usize(self) -> usize { self as usize } | ||
| impl Index for usize { | ||
| const ZERO: Self = 0; | ||
| #[inline(always)] | ||
@@ -85,0 +92,0 @@ fn to_usize(self) -> usize { self } |
+1
-0
@@ -66,2 +66,3 @@ // Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT | ||
| #[test] | ||
| #[cfg_attr(miri, ignore)] // Miri is too slow | ||
| fn test_encode_utf8() { | ||
@@ -68,0 +69,0 @@ // Test that all codepoints are encoded correctly |
+1
-5
@@ -36,7 +36,3 @@ use std::fmt; | ||
| /// Requires `features="std"`. | ||
| impl<T: Any> Error for CapacityError<T> { | ||
| fn description(&self) -> &str { | ||
| CAPERROR | ||
| } | ||
| } | ||
| impl<T: Any> Error for CapacityError<T> {} | ||
@@ -43,0 +39,0 @@ impl<T> fmt::Display for CapacityError<T> { |
+68
-11
@@ -17,2 +17,8 @@ //! **arrayvec** provides the types `ArrayVec` and `ArrayString`: | ||
| //! | ||
| //! - `unstable-const-fn` | ||
| //! - Optional | ||
| //! - Makes [`ArrayVec::new`] and [`ArrayString::new`] `const fn`s, | ||
| //! using the nightly `const_fn` feature. | ||
| //! - Unstable and requires nightly. | ||
| //! | ||
| //! ## Rust Version | ||
@@ -24,2 +30,3 @@ //! | ||
| #![cfg_attr(not(feature="std"), no_std)] | ||
| #![cfg_attr(feature="unstable-const-fn", feature(const_fn))] | ||
@@ -86,5 +93,3 @@ #[cfg(feature="serde")] | ||
| // NoDrop inhibits array's drop | ||
| // panic safety: NoDrop::drop will trigger on panic, so the inner | ||
| // array will not drop even after panic. | ||
| // MaybeUninit inhibits array's drop | ||
| } | ||
@@ -114,8 +119,16 @@ } | ||
| /// ``` | ||
| #[cfg(not(feature="unstable-const-fn"))] | ||
| pub fn new() -> ArrayVec<A> { | ||
| unsafe { | ||
| ArrayVec { xs: MaybeUninit::uninitialized(), len: Index::from(0) } | ||
| ArrayVec { xs: MaybeUninit::uninitialized(), len: Index::ZERO } | ||
| } | ||
| } | ||
| #[cfg(feature="unstable-const-fn")] | ||
| pub const fn new() -> ArrayVec<A> { | ||
| unsafe { | ||
| ArrayVec { xs: MaybeUninit::uninitialized(), len: Index::ZERO } | ||
| } | ||
| } | ||
| /// Return the number of elements in the `ArrayVec`. | ||
@@ -133,2 +146,14 @@ /// | ||
| /// Returns whether the `ArrayVec` is empty. | ||
| /// | ||
| /// ``` | ||
| /// use arrayvec::ArrayVec; | ||
| /// | ||
| /// let mut array = ArrayVec::from([1]); | ||
| /// array.pop(); | ||
| /// assert_eq!(array.is_empty(), true); | ||
| /// ``` | ||
| #[inline] | ||
| pub fn is_empty(&self) -> bool { self.len() == 0 } | ||
| /// Return the capacity of the `ArrayVec`. | ||
@@ -553,3 +578,3 @@ /// | ||
| unsafe { | ||
| let dst = self.xs.ptr_mut().offset(self_len as isize); | ||
| let dst = self.xs.ptr_mut().add(self_len); | ||
| ptr::copy_nonoverlapping(other.as_ptr(), dst, other_len); | ||
@@ -609,8 +634,11 @@ self.set_len(self_len + other_len); | ||
| let len = self.len(); | ||
| // bounds check happens here | ||
| // bounds check happens here (before length is changed!) | ||
| let range_slice: *const _ = &self[start..end]; | ||
| // Calling `set_len` creates a fresh and thus unique mutable references, making all | ||
| // older aliases we created invalid. So we cannot call that function. | ||
| self.len = Index::from(start); | ||
| unsafe { | ||
| // set self.vec length's to start, to be safe in case Drain is leaked | ||
| self.set_len(start); | ||
| Drain { | ||
@@ -705,2 +733,31 @@ tail_start: end, | ||
| /// Try to create an `ArrayVec` from a slice. This will return an error if the slice was too big to | ||
| /// fit. | ||
| /// | ||
| /// ``` | ||
| /// use arrayvec::ArrayVec; | ||
| /// use std::convert::TryInto as _; | ||
| /// | ||
| /// let array: ArrayVec<[_; 4]> = (&[1, 2, 3] as &[_]).try_into().unwrap(); | ||
| /// assert_eq!(array.len(), 3); | ||
| /// assert_eq!(array.capacity(), 4); | ||
| /// ``` | ||
| impl<A: Array> std::convert::TryFrom<&[A::Item]> for ArrayVec<A> | ||
| where | ||
| A::Item: Clone, | ||
| { | ||
| type Error = CapacityError; | ||
| fn try_from(slice: &[A::Item]) -> Result<Self, Self::Error> { | ||
| if A::CAPACITY < slice.len() { | ||
| Err(CapacityError::new(())) | ||
| } else { | ||
| let mut array = Self::new(); | ||
| array.extend(slice.iter().cloned()); | ||
| Ok(array) | ||
| } | ||
| } | ||
| } | ||
| /// Iterate the `ArrayVec` with references to each element. | ||
@@ -906,4 +963,4 @@ /// | ||
| let tail = self.tail_start; | ||
| let src = source_vec.as_ptr().offset(tail as isize); | ||
| let dst = source_vec.as_mut_ptr().offset(start as isize); | ||
| let src = source_vec.as_ptr().add(tail); | ||
| let dst = source_vec.as_mut_ptr().add(start); | ||
| ptr::copy(src, dst, self.tail_len); | ||
@@ -977,3 +1034,3 @@ source_vec.set_len(start + self.tail_len); | ||
| } else { | ||
| ptr.offset(offset as isize) | ||
| ptr.add(offset) | ||
| } | ||
@@ -980,0 +1037,0 @@ } |
@@ -19,3 +19,3 @@ | ||
| /// Create a new MaybeUninit with uninitialized interior | ||
| pub unsafe fn uninitialized() -> Self { | ||
| pub const unsafe fn uninitialized() -> Self { | ||
| MaybeUninit { inner: StdMaybeUninit::uninit() } | ||
@@ -22,0 +22,0 @@ } |
+9
-0
@@ -69,2 +69,11 @@ extern crate arrayvec; | ||
| #[test] | ||
| fn test_try_from_slice_error() { | ||
| use arrayvec::ArrayVec; | ||
| use std::convert::TryInto as _; | ||
| let res: Result<ArrayVec<[_; 2]>, _> = (&[1, 2, 3] as &[_]).try_into(); | ||
| assert_matches!(res, Err(_)); | ||
| } | ||
| #[test] | ||
| fn test_u16_index() { | ||
@@ -71,0 +80,0 @@ const N: usize = 4096; |
-259
| arrayvec | ||
| ======== | ||
| A vector with fixed capacity. | ||
| Please read the `API documentation here`__ | ||
| __ https://docs.rs/arrayvec | ||
| |build_status|_ |crates|_ |crates2|_ | ||
| .. |build_status| image:: https://travis-ci.org/bluss/arrayvec.svg | ||
| .. _build_status: https://travis-ci.org/bluss/arrayvec | ||
| .. |crates| image:: http://meritbadge.herokuapp.com/arrayvec | ||
| .. _crates: https://crates.io/crates/arrayvec | ||
| .. |crates2| image:: http://meritbadge.herokuapp.com/nodrop | ||
| .. _crates2: https://crates.io/crates/nodrop | ||
| Recent Changes (arrayvec) | ||
| ------------------------- | ||
| - 0.5.1 | ||
| - Add ``as_ptr``, ``as_mut_ptr`` accessors directly on the ``ArrayVec`` by @tbu- | ||
| (matches the same addition to ``Vec`` which happened in Rust 1.37). | ||
| - Add method ``ArrayString::len`` (now available directly, not just through deref to str). | ||
| - Use raw pointers instead of ``&mut [u8]`` for encoding chars into ``ArrayString`` | ||
| (uninit best practice fix). | ||
| - Use raw pointers instead of ``get_unchecked_mut`` where the target may be | ||
| uninitialized a everywhere relevant in the ArrayVec implementation | ||
| (uninit best practice fix). | ||
| - Changed inline hints on many methods, mainly removing inline hints | ||
| - ``ArrayVec::dispose`` is now deprecated (it has no purpose anymore) | ||
| - 0.4.12 | ||
| - Use raw pointers instead of ``get_unchecked_mut`` where the target may be | ||
| uninitialized a everywhere relevant in the ArrayVec implementation. | ||
| - 0.5.0 | ||
| - Use ``MaybeUninit`` (now unconditionally) in the implementation of | ||
| ``ArrayVec`` | ||
| - Use ``MaybeUninit`` (now unconditionally) in the implementation of | ||
| ``ArrayString`` | ||
| - The crate feature for serde serialization is now named ``serde``. | ||
| - Updated the ``Array`` trait interface, and it is now easier to use for | ||
| users outside the crate. | ||
| - Add ``FromStr`` impl for ``ArrayString`` by @despawnerer | ||
| - Add method ``try_extend_from_slice`` to ``ArrayVec``, which is always | ||
| effecient by @Thomasdezeeuw. | ||
| - Add method ``remaining_capacity`` by @Thomasdezeeuw | ||
| - Improve performance of the ``extend`` method. | ||
| - The index type of zero capacity vectors is now itself zero size, by | ||
| @clarfon | ||
| - Use ``drop_in_place`` for truncate and clear methods. This affects drop order | ||
| and resume from panic during drop. | ||
| - Use Rust 2018 edition for the implementation | ||
| - Require Rust 1.36 or later, for the unconditional ``MaybeUninit`` | ||
| improvements. | ||
| - 0.4.11 | ||
| - In Rust 1.36 or later, use newly stable MaybeUninit. This extends the | ||
| soundness work introduced in 0.4.9, we are finally able to use this in | ||
| stable. We use feature detection (build script) to enable this at build | ||
| time. | ||
| - 0.4.10 | ||
| - Use ``repr(C)`` in the ``union`` version that was introduced in 0.4.9, to | ||
| allay some soundness concerns. | ||
| - 0.4.9 | ||
| - Use ``union`` in the implementation on when this is detected to be supported | ||
| (nightly only for now). This is a better solution for treating uninitialized | ||
| regions correctly, and we'll use it in stable Rust as soon as we are able. | ||
| When this is enabled, the ``ArrayVec`` has no space overhead in its memory | ||
| layout, although the size of the vec should not be relied upon. (See `#114`_) | ||
| - ``ArrayString`` updated to not use uninitialized memory, it instead zeros its | ||
| backing array. This will be refined in the next version, since we | ||
| need to make changes to the user visible API. | ||
| - The ``use_union`` feature now does nothing (like its documentation foretold). | ||
| .. _`#114`: https://github.com/bluss/arrayvec/pull/114 | ||
| - 0.4.8 | ||
| - Implement Clone and Debug for ``IntoIter`` by @clarcharr | ||
| - Add more array sizes under crate features. These cover all in the range | ||
| up to 128 and 129 to 255 respectively (we have a few of those by default): | ||
| - ``array-size-33-128`` | ||
| - ``array-size-129-255`` | ||
| - 0.4.7 | ||
| - Fix future compat warning about raw pointer casts | ||
| - Use ``drop_in_place`` when dropping the arrayvec by-value iterator | ||
| - Decrease mininum Rust version (see docs) by @jeehoonkang | ||
| - 0.3.25 | ||
| - Fix future compat warning about raw pointer casts | ||
| - 0.4.6 | ||
| - Fix compilation on 16-bit targets. This means, the 65536 array size is not | ||
| included on these targets. | ||
| - 0.3.24 | ||
| - Fix compilation on 16-bit targets. This means, the 65536 array size is not | ||
| included on these targets. | ||
| - Fix license files so that they are both included (was fixed in 0.4 before) | ||
| - 0.4.5 | ||
| - Add methods to ``ArrayString`` by @DenialAdams: | ||
| - ``.pop() -> Option<char>`` | ||
| - ``.truncate(new_len)`` | ||
| - ``.remove(index) -> char`` | ||
| - Remove dependency on crate odds | ||
| - Document debug assertions in unsafe methods better | ||
| - 0.4.4 | ||
| - Add method ``ArrayVec::truncate()`` by @niklasf | ||
| - 0.4.3 | ||
| - Improve performance for ``ArrayVec::extend`` with a lower level | ||
| implementation (#74) | ||
| - Small cleanup in dependencies (use no std for crates where we don't need more) | ||
| - 0.4.2 | ||
| - Add constructor method ``new`` to ``CapacityError``. | ||
| - 0.4.1 | ||
| - Add ``Default`` impl to ``ArrayString`` by @tbu- | ||
| - 0.4.0 | ||
| - Reformed signatures and error handling by @bluss and @tbu-: | ||
| - ``ArrayVec``'s ``push, insert, remove, swap_remove`` now match ``Vec``'s | ||
| corresponding signature and panic on capacity errors where applicable. | ||
| - Add fallible methods ``try_push, insert`` and checked methods | ||
| ``pop_at, swap_pop``. | ||
| - Similar changes to ``ArrayString``'s push methods. | ||
| - Use a local version of the ``RangeArgument`` trait | ||
| - Add array sizes 50, 150, 200 by @daboross | ||
| - Support serde 1.0 by @daboross | ||
| - New method ``.push_unchecked()`` by @niklasf | ||
| - ``ArrayString`` implements ``PartialOrd, Ord`` by @tbu- | ||
| - Require Rust 1.14 | ||
| - crate feature ``use_generic_array`` was dropped. | ||
| - 0.3.23 | ||
| - Implement ``PartialOrd, Ord`` as well as ``PartialOrd<str>`` for | ||
| ``ArrayString``. | ||
| - 0.3.22 | ||
| - Implement ``Array`` for the 65536 size | ||
| - 0.3.21 | ||
| - Use ``encode_utf8`` from crate odds | ||
| - Add constructor ``ArrayString::from_byte_string`` | ||
| - 0.3.20 | ||
| - Simplify and speed up ``ArrayString``’s ``.push(char)``- | ||
| - 0.3.19 | ||
| - Add new crate feature ``use_generic_array`` which allows using their | ||
| ``GenericArray`` just like a regular fixed size array for the storage | ||
| of an ``ArrayVec``. | ||
| - 0.3.18 | ||
| - Fix bounds check in ``ArrayVec::insert``! | ||
| It would be buggy if ``self.len() < index < self.capacity()``. Take note of | ||
| the push out behavior specified in the docs. | ||
| - 0.3.17 | ||
| - Added crate feature ``use_union`` which forwards to the nodrop crate feature | ||
| - Added methods ``.is_full()`` to ``ArrayVec`` and ``ArrayString``. | ||
| - 0.3.16 | ||
| - Added method ``.retain()`` to ``ArrayVec``. | ||
| - Added methods ``.as_slice(), .as_mut_slice()`` to ``ArrayVec`` and ``.as_str()`` | ||
| to ``ArrayString``. | ||
| - 0.3.15 | ||
| - Add feature std, which you can opt out of to use ``no_std`` (requires Rust 1.6 | ||
| to opt out). | ||
| - Implement ``Clone::clone_from`` for ArrayVec and ArrayString | ||
| - 0.3.14 | ||
| - Add ``ArrayString::from(&str)`` | ||
| - 0.3.13 | ||
| - Added ``DerefMut`` impl for ``ArrayString``. | ||
| - Added method ``.simplify()`` to drop the element for ``CapacityError``. | ||
| - Added method ``.dispose()`` to ``ArrayVec`` | ||
| - 0.3.12 | ||
| - Added ArrayString, a fixed capacity analogy of String | ||
| - 0.3.11 | ||
| - Added trait impls Default, PartialOrd, Ord, Write for ArrayVec | ||
| - 0.3.10 | ||
| - Go back to using external NoDrop, fixing a panic safety bug (issue #3) | ||
| - 0.3.8 | ||
| - Inline the non-dropping logic to remove one drop flag in the | ||
| ArrayVec representation. | ||
| - 0.3.7 | ||
| - Added method .into_inner() | ||
| - Added unsafe method .set_len() | ||
| License | ||
| ======= | ||
| Dual-licensed to be compatible with the Rust project. | ||
| Licensed under the Apache License, Version 2.0 | ||
| http://www.apache.org/licenses/LICENSE-2.0 or the MIT license | ||
| http://opensource.org/licenses/MIT, at your | ||
| option. This file may not be copied, modified, or distributed | ||
| except according to those terms. | ||
Sorry, the diff of this file is not supported yet