9.4 KiB
Recent Changes (arrayvec)
0.7.2
- Add
.as_mut_str()toArrayStringby @clarfonthey - Add
remaining_capacitytoArrayStringby @bhgomes - Add
zero_filledconstructor by @c410-f3r - Optimize
retainby @TennyZhuang and @niklasf - Make the following methods
constby @bhgomes:- len
- is_empty
- capacity
- is_full
- remaining_capacity
- CapacityError::new
0.7.1
- Add new ArrayVec methods
.take()and.into_inner_unchecked()by @conradludgate clone_fromnow usestruncatewhen needed by @a1phyr
0.7.0
-
fn new_constis now the way to const-construct arrayvec and arraystring, andfn newhas 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-fnwas removed, since it's not needed -
Optimize
.retain()by using the same algorithm as in std, change by @niklasf, issue #174. Original optimization in Rust std by @oxalica in rust-lang/rust/pull/81126
0.6.1
-
The
ArrayVec::newandArrayString::newconstructors are properly const fns on stable and the feature flagunstable-const-fnis now deprecated. by @rodrimati1992 -
Small fix to the capacity check macro by @Xaeroxe
-
Typo fix in documentation by @cuviper
-
Small code cleanup by @bluss
0.6.0
-
The const generics release 🎉. Arrayvec finally implements what it wanted to implement, since its first version: a vector backed by an array, with generic parameters for the arbitrary element type and backing array capacity.
The New type syntax is
ArrayVec<T, CAP>whereCAPis the arrayvec capacity. For arraystring the syntax isArrayString<CAP>.Length is stored internally as u32; this limits the maximum capacity. The size of the
ArrayVecorArrayStringstructs for the same capacity may grow slightly compared with the previous version (depending on padding requirements for the element type). Change by @bluss. -
Arrayvec's
.extend()andFromIterator/.collect()to arrayvec now panic if the capacity of the arrayvec is exceeded. Change by @bluss. -
Arraystring now implements
TryFrom<&str>andTryFrom<fmt::Arguments>by @c410-f3r -
Minimum supported rust version is Rust 1.51
0.5.2
- Add
is_emptymethods for ArrayVec and ArrayString by @nicbn - Implement
TryFrom<Slice>for ArrayVec by @paulkernfeld - Add
unstable-const-fnto makenewmethods 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::descriptionby @AnderEnder - Use pointer method
addby @hbina
0.5.1
- Add
as_ptr,as_mut_ptraccessors directly on theArrayVecby @tbu- (matches the same addition toVecwhich 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 intoArrayString(uninit best practice fix). - Use raw pointers instead of
get_unchecked_mutwhere 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::disposeis now deprecated (it has no purpose anymore)
0.4.12
- Use raw pointers instead of
get_unchecked_mutwhere the target may be uninitialized everywhere relevant in the ArrayVec implementation.
0.5.0
- Use
MaybeUninit(now unconditionally) in the implementation ofArrayVec - Use
MaybeUninit(now unconditionally) in the implementation ofArrayString - The crate feature for serde serialization is now named
serde. - Updated the
Arraytrait interface, and it is now easier to use for users outside the crate. - Add
FromStrimpl forArrayStringby @despawnerer - Add method
try_extend_from_slicetoArrayVec, which is always effecient by @Thomasdezeeuw. - Add method
remaining_capacityby @Thomasdezeeuw - Improve performance of the
extendmethod. - The index type of zero capacity vectors is now itself zero size, by @clarfon
- Use
drop_in_placefor 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
MaybeUninitimprovements.
Older releases
-
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.
- In Rust 1.36 or later, use newly stable
-
0.4.10
- Use
repr(C)in theunionversion that was introduced in 0.4.9, to allay some soundness concerns.
- Use
-
0.4.9
- Use
unionin 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, theArrayVechas no space overhead in its memory layout, although the size of the vec should not be relied upon. (See #114) ArrayStringupdated 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_unionfeature now does nothing (like its documentation foretold).
- Use
-
0.4.8
-
Implement Clone and Debug for
IntoIterby @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-128array-size-129-255
-
-
0.4.7
- Fix future compat warning about raw pointer casts
- Use
drop_in_placewhen 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
ArrayStringby @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
- Add method
-
0.4.3
- Improve performance for
ArrayVec::extendwith a lower level implementation (#74) - Small cleanup in dependencies (use no std for crates where we don't need more)
- Improve performance for
-
0.4.2
- Add constructor method
newtoCapacityError.
- Add constructor method
-
0.4.1
- Add
Defaultimpl toArrayStringby @tbu-
- Add
-
0.4.0
-
Reformed signatures and error handling by @bluss and @tbu-:
ArrayVec'spush, insert, remove, swap_removenow matchVec's corresponding signature and panic on capacity errors where applicable.- Add fallible methods
try_push, insertand checked methodspop_at, swap_pop. - Similar changes to
ArrayString's push methods.
-
Use a local version of the
RangeArgumenttrait -
Add array sizes 50, 150, 200 by @daboross
-
Support serde 1.0 by @daboross
-
New method
.push_unchecked()by @niklasf -
ArrayStringimplementsPartialOrd, Ordby @tbu- -
Require Rust 1.14
-
crate feature
use_generic_arraywas dropped.
-
-
0.3.23
- Implement
PartialOrd, Ordas well asPartialOrd<str>forArrayString.
- Implement
-
0.3.22
- Implement
Arrayfor the 65536 size
- Implement
-
0.3.21
- Use
encode_utf8from crate odds - Add constructor
ArrayString::from_byte_string
- Use
-
0.3.20
- Simplify and speed up
ArrayString’s.push(char)-
- Simplify and speed up
-
0.3.19
- Add new crate feature
use_generic_arraywhich allows using theirGenericArrayjust like a regular fixed size array for the storage of anArrayVec.
- Add new crate feature
-
0.3.18
- Fix bounds check in
ArrayVec::insert! It would be buggy ifself.len() < index < self.capacity(). Take note of the push out behavior specified in the docs.
- Fix bounds check in
-
0.3.17
- Added crate feature
use_unionwhich forwards to the nodrop crate feature - Added methods
.is_full()toArrayVecandArrayString.
- Added crate feature
-
0.3.16
- Added method
.retain()toArrayVec. - Added methods
.as_slice(), .as_mut_slice()toArrayVecand.as_str()toArrayString.
- Added method
-
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_fromfor ArrayVec and ArrayString
- Add feature std, which you can opt out of to use
-
0.3.14
- Add
ArrayString::from(&str)
- Add
-
0.3.13
- Added
DerefMutimpl forArrayString. - Added method
.simplify()to drop the element forCapacityError. - Added method
.dispose()toArrayVec
- Added
-
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()