Commit Graph

14 Commits

Author SHA1 Message Date
Soveu 66077cfa99 Pre-allocate memory in extend_from_slice, extend and append functions (#80)
* change behavior on extend_from_slice, append

* preallocation in extend()

* append v2

* obviously

* fix resize_with
2020-07-17 10:21:06 -06:00
Lokathor 5bb7c7585b Closes https://github.com/Lokathor/tinyvec/issues/75 (#77)
* Closes https://github.com/Lokathor/tinyvec/issues/75

* This is a breaking change to the macro

* benchmarks fixes.

* slim down to just `take`
2020-07-03 10:56:45 -06:00
Benjamin Scherer fb92d14ab4 Modify tiny_vec! to avoid error on non-Copy types (#74)
* Modify tiny_vec! to avoid error on non-Copy types

Using $elem in two closures in the previous version of the macro created
errors when using types that don't implement Copy. Moving the decision
of whether to allocate or use an inline array to the macro invocation
resolves this error as the borrow checker can see that both branches are
never taken together.

* Add test for tiny_vec! using non-Copy types

* Fix inference issue

* Use full crate path in tiny_vec!
2020-06-18 09:22:21 -06:00
Lokathor c81bc9f0b1 Add the SliceVec type (#68)
* start of slicevec

* remove todo! because it's not in 1.36

* Update Cargo.toml

* slice vec into iterator

* slicevec drain

* complete last unimplemented

* remove the extra default feature

* spelling

* Update src/slicevec.rs

Co-Authored-By: Joshua Nelson <joshua@yottadb.com>

* docs clarification.

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-04-22 12:31:56 -06:00
Evgeny Rozaliev 5ba37a6b3a TinyVec::from([T]) (#66) 2020-03-17 14:15:39 -06:00
Wesley Norris 48905d9c43 Add TinyVec::from(slice) test 2020-01-24 08:24:44 -05:00
Lokathor 032ac155c9 cargo fmt hasn't been used in a while it seems. 2020-01-19 13:02:54 -07:00
mental 59257ad80f Account for heap capacity in capacity unit test 2020-01-19 05:07:35 +00:00
mental dd802b30fa Account for heap allocated capacities. 2020-01-19 04:57:34 +00:00
Lokathor 50b84c54b1 docs and rename the feature to alloc
Closes https://github.com/Lokathor/tinyvec/issues/18
We could discuss the "goals" section more of course, but for now it's enough to call that issue closed.
2020-01-13 19:55:38 -07:00
Lokathor bc20225012 Merge pull request #16 from Nemo157/fix-resize
Fix TinyVec::resize across inline/heap boundary
2020-01-13 18:49:19 -07:00
Wim Looman 2049895f28 Fix TinyVec::resize across inline/heap boundary 2020-01-13 20:21:46 +01:00
Wim Looman cc6b7d4b46 Fix ArrayishVec::swap_remove for last element 2020-01-13 19:42:49 +01:00
Wim Looman 18300412ff Fix TinyVec::drain implementation 2020-01-12 14:07:19 +01:00