Commit Graph

26 Commits

Author SHA1 Message Date
Lokathor 05eb8bf101 clippy 2020-01-26 13:47:24 -07:00
Lokathor 4d820bf22b Merge branch 'master' into small-updates 2020-01-26 13:37:57 -07:00
Lokathor 10e37daeb7 Merge pull request #56 from mgostIH/drain
Added more efficient implementation for ArrayVecDrain
2020-01-26 12:39:16 -07:00
mgostIH da82aa007a Added more efficient implementation for ArrayVecDrain, changed a few internal members of the struct, tests passed 2020-01-26 13:51:25 +01:00
Wim Looman 44455944d4 impl Debug for {Tiny,Array}VecIterator 2020-01-24 14:40:17 +01:00
Lokathor d6d1c9db07 Convert code notes into GitHub issues 2020-01-24 02:46:18 -07:00
Lokathor ca709b0864 cleanups 2020-01-24 02:38:18 -07:00
Lokathor 4907f0267f add Hash to ArrayVec and TinyVec 2020-01-20 18:48:18 -07:00
Lokathor 30516bc4d6 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 b008c95a37 improve ArrayVec::push panic message
Closes https://github.com/Lokathor/tinyvec/issues/24
2020-01-19 12:59:21 -07:00
Lokathor b19f3928f9 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 e87dfb7b25 Merge pull request #34 from HeroicKatora/retain
Implement linear time retain
2020-01-18 19:00:53 -07:00
Andreas Molzer 83664ad87e 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 4cbd1db0a0 Fix element drop order on failed insert 2020-01-18 19:02:22 +01:00
Andreas Molzer b23ac5d886 Implement linear time retain 2020-01-18 18:37:38 +01:00
Andreas Molzer 04c799ffcf 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 a8c5b4e7ac 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
Andreas Molzer 2f94e40d81 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
Andreas Molzer fd3c92c351 Test and fix removal at past-the-end index 2020-01-18 13:24:58 +01:00
Lokathor 66c99e290b We'll call this a 1.0 canidate! 2020-01-18 00:16:25 -07:00
Lokathor 2d484cbebe remove the try_push thing 2020-01-17 23:28:25 -07:00
Lokathor 6afb9103ea breaking: make Array trait follow standard Rust naming 2020-01-17 22:47:53 -07:00
Lokathor a59fe3ebc9 Update arrayvec.rs 2020-01-15 19:45:49 -07:00
Lokathor 5e5c0385cc doc them nightly methods. 2020-01-13 21:38:15 -07:00
Lokathor 822b590f4c more docs, more renames, closer to being good. 2020-01-13 21:34:22 -07:00
Lokathor 85377b6815 rename arrayish to array I guess
The "ish" part was always supposed to be temporary.
2020-01-13 21:12:04 -07:00