mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-18 20:34:34 -04:00
04f65e50cf
* Add ArrayVec::splice and TinyVec::splice Added for closer API parity with std::Vec * Fix ArrayVec::splice example typo * Removed FusedIterator bound from splice This bound could've caused confusing error messages, and was inconsistent with the Vec API. splice now uses fuse itself to ensure consistency. Vec::splice consumes the whole iterator at once, so it essentially has the same behavior, but this implementation gradually consumes the iterator as elements are drained, so this fuse is necessary to keep the behavior the same. * Reserve additional capacity in TinyVecSplice Used TinyVec::reserve to pre-allocate space for elements being spliced into the TinyVec after the splicing iterator is dropped. Used the lower bound like Vec's splice does. * Run rustfmt