Lokathor
032ac155c9
cargo fmt hasn't been used in a while it seems.
2020-01-19 13:02:54 -07:00
Lokathor
11b8f629f2
greatly improve extend_from_slice (+formatting)
...
Closes https://github.com/Lokathor/tinyvec/issues/25
(Thanks ThatsNoMoon!)
2020-01-19 13:02:14 -07:00
Lokathor
6a4491c47b
improve ArrayVec::push panic message
...
Closes https://github.com/Lokathor/tinyvec/issues/24
2020-01-19 12:59:21 -07:00
Lokathor
6daae8d5fa
Merge pull request #37 from mental32/26-fix-tinyvec-capacity
...
Account for heap allocated capacities.
2020-01-18 23:14:19 -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
fc564bfc25
Merge pull request #36 from HeroicKatora/fill
...
Add a fill method, a panic-free extend alternative
2020-01-18 19:14:17 -07:00
Lokathor
d8f6f36e05
Merge pull request #34 from HeroicKatora/retain
...
Implement linear time retain
2020-01-18 19:00:53 -07:00
Lokathor
add870dfd1
Merge pull request #35 from HeroicKatora/insert
...
Fix element drop order on failed insert
2020-01-18 18:54:33 -07:00
Andreas Molzer
89c1023f1b
Add a fill method, a panic-free extend alternative
...
This is an alternative to `Extend::extend` method for cases where the
length of the iterator can not be checked. Since this vector can not
reallocate to increase its capacity, it is unclear what to do with
remaining elements in the iterator and the iterator itself. The
interface also provides no way to communicate this to the caller.
2020-01-18 19:28:36 +01:00
Andreas Molzer
cd4cd34c47
Fix element drop order on failed insert
2020-01-18 19:02:22 +01:00
Andreas Molzer
52f8446e40
Implement linear time retain
2020-01-18 18:37:38 +01:00
Lokathor
23aafa1825
Merge pull request #33 from HeroicKatora/simplify
...
Some Simplifications and efficiency changes
2020-01-18 10:33:24 -07:00
Andreas Molzer
c21132b495
Simplify resize with element or function
...
Avoids a call to Clone of the element by using the provided instance as
the one inserted last. A similar optimization is used in the standard
library. Also changes the iteration to an independent iterator as the
number of insert elements must be known in advance.
2020-01-18 18:27:03 +01:00
Andreas Molzer
381eacaa46
Use mem::take shorthand for defaulted replace
...
This makes the code more readable by shortening lines and avoid explicit
or redundant type annotations. The core function would require a rust
version of 1.40 so straightforward implementation is added to the crate.
2020-01-18 18:26:10 +01:00
Lokathor
8eaaec04e8
Merge pull request #23 from WildCryptoFox/const-generics
...
add nightly_const_generics flag
2020-01-18 10:02:29 -07:00
Andreas Molzer
eed51be53b
Switch to slice swapping for split
...
The new slice is already initialized with default values for T due to
the constructor used. Instead of using different defaulted values for
replacing the split-off instances we can simply swap slices. This
reduces pressure on the optimizer and uses a probably optimized method
from the core library.
2020-01-18 17:24:27 +01:00
Lokathor
ff7eaa0f8a
Merge pull request #29 from HeroicKatora/remove
...
Test and fix removal at past-the-end index
2020-01-18 09:16:46 -07:00
Lokathor
8b9be714b5
Merge pull request #30 from HeroicKatora/fuzz-target
...
Fix the fuzz target
2020-01-18 09:16:06 -07:00
Andreas Molzer
5db2b64f78
Fix the fuzz target
...
Was broken due to renaming in c74c1e3785 .
2020-01-18 13:36:46 +01:00
Andreas Molzer
fd28ecb105
Test and fix removal at past-the-end index
2020-01-18 13:24:58 +01:00
Lokathor
26ff5dd822
We'll call this a 1.0 canidate!
2020-01-18 00:16:25 -07:00
Lokathor
9a726afafa
remove the try_push thing
2020-01-17 23:28:25 -07:00
Lokathor
770d2f01b7
docs
2020-01-17 22:56:29 -07:00
Lokathor
ba3c74707e
docs
2020-01-17 22:56:18 -07:00
Lokathor
6423cba954
breaking: make Array trait follow standard Rust naming
2020-01-17 22:47:53 -07:00
James McGlashan
c49be7b254
add nightly_const_generics flag
2020-01-18 00:00:00 +00:00
Lokathor
d17dca2c5b
Merge pull request #19 from Lokathor/description-editing
...
Editing pass on crate description
2020-01-17 01:17:05 -07:00
Lokathor
4bd7d65e32
Update arrayvec.rs
2020-01-15 19:45:49 -07:00
Sergey "Shnatsel" Davidoff
59f532eaa5
Editing pass on crate description
...
I've toned it down a bit, otherwise it feels too confrontational/hostile which may put off some users
2020-01-14 20:24:14 +01:00
Lokathor
463b595da9
doc them nightly methods.
2020-01-13 21:38:15 -07:00
Lokathor
b2c3141a6a
more docs, more renames, closer to being good.
2020-01-13 21:34:22 -07:00
Lokathor
c74c1e3785
rename arrayish to array I guess
...
The "ish" part was always supposed to be temporary.
2020-01-13 21:12:04 -07:00
Lokathor
ad19a26ca5
Update README.md
2020-01-13 20:16:05 -07:00
Lokathor
1b54a3df9c
try checking Nightly stuff just in the Nightly run.
2020-01-13 20:10:48 -07:00
Lokathor
59ae971a47
whoops, gotta adjust the CI too.
2020-01-13 20:06:35 -07: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
Lokathor
7467bb56d4
Merge pull request #17 from Nemo157/arbitrary-model-tests-2
...
Extend methods run through arbitrary-model-tests
2020-01-13 18:47:26 -07:00
Lokathor
6060b27950
Merge pull request #15 from Nemo157/fix-swap_remove
...
Fix ArrayishVec::swap_remove for last element
2020-01-13 18:46:38 -07:00
Wim Looman
2049895f28
Fix TinyVec::resize across inline/heap boundary
2020-01-13 20:21:46 +01:00
Wim Looman
8780cb5fe1
Extend methods run through arbitrary-model-tests
2020-01-13 19:57:28 +01:00
Wim Looman
cc6b7d4b46
Fix ArrayishVec::swap_remove for last element
2020-01-13 19:42:49 +01:00
Lokathor
2f5823df14
Merge pull request #14 from Nemo157/arbitrary-model-tests
...
Add basic arbitrary-model-tests based fuzzing
2020-01-13 00:09:43 -07:00
Wim Looman
18300412ff
Fix TinyVec::drain implementation
2020-01-12 14:07:19 +01:00
Wim Looman
ea17f80919
Add fuzzing of TinyVec as well
2020-01-12 14:03:52 +01:00
Wim Looman
5567e85dc7
Fix ArrayishVec::drain implementation
...
The end bound was off by one
2020-01-12 13:54:35 +01:00
Wim Looman
a69a5aab0d
Add basic arbitrary-model-tests based fuzzing
2020-01-12 13:54:05 +01:00
Lokathor
4d64d51cd9
CI fixes
2020-01-11 18:58:08 -07:00
Lokathor
31133835a5
be 1.36 compatible
2020-01-11 18:50:00 -07:00