arrayvec
arrayvec copied to clipboard
A vector with a fixed capacity. (Rust)
# Motivation - Following rustfmt generally increases willingness in contributing to the project. - Removing cogitive overhead in reviewing potentially important PR #222. Seems like a few of your personal...
It mainly caused by borrowing whole internal array in `as_mut_ptr` and `as_ptr`. Stdlib `Vec` doesn't suffer from this because it keeps pointer to data internally so it doesn't reborrow slice...
Follows rust-lang/rust#91527. This is neutral in my go-to benchmarks, but it's probably good to keep the implementation in sync regardless. Edit: Looks like miri does not like this, whereas it...
In these function you use the unsafe keyword for some safe expressions. We need to mark unsafe operations more precisely using unsafe keyword. Keeping unsafe blocks small can bring many...
# Configuration arrayvec 0.7.2 default features ``` >cargo +nightly miri --version --verbose miri 0.1.0 (cde87d1 2022-07-08) >rustc +nightly --version --verbose rustc 1.64.0-nightly (87588a2af 2022-07-13) binary: rustc commit-hash: 87588a2afd9ca903366f0deaf84d805f34469384 commit-date: 2022-07-13...
Storing the length as [`NonMaxU32`](https://docs.rs/nonmax/latest/nonmax/struct.NonMaxU32.html) would allow compiler to optimize `Option` size by storing `None` as impossible length value (`u32::MAX`).
Leveraging the existing `as_str` to implement `AsRef`, so that ArrayString can be used as a drop-in replacement for String in a few more places.
`ArraySting` already implements `DerefMut` so `AsMut` is like a missing piece It is worth noting that `String` also implements `AsMut`
This allows nested comparisons: ```rust fn test_nested_eq() { let array: ArrayVec = (0..3) .map(|i| ArrayVec::from([i, i + 1])) .collect(); assert_eq!(array, [[0, 1], [1, 2], [2, 3]]); } fn test_vec_of_strings_equality() {...
We don't need curl and https://rust-lang.github.io/rustup-components-history/ any more now that rustup can install "latest toolchain with certain tools".