39: Implement FromIterator for Vec r=japaric a=XOSplicer
As discussed in #36
Panics when the vector can not hold all values supplied by the iterator.
Calling `unwrap` on the result might not be the best choice here.
It might be better to match the result and have a custom panic message.
Is this the best possible behavior?
Co-authored-by: Felix <stegmaier.felix@gmail.com>
Co-authored-by: Felix Stegmaier <stegmaier.felix@gmail.com>
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
38: Implement IntoIter for Vec r=japaric a=XOSplicer
~~This implementation uses vec::reverse and vec::pop to move the content of the vector out of it.~~
It might give more performance to avoid the `reverse` and read each element individually. In the end the unmoved items need to be dropped.
Co-authored-by: Felix <stegmaier.felix@gmail.com>
Co-authored-by: Felix Stegmaier <stegmaier.felix@gmail.com>
28: drop untagged-option dependency, and depend on generic-array r=japaric a=japaric
closes#21closes#23
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
26: Ringbuffer iterators macro r=japaric a=XOSplicer
Resolves#6
Refactor the ring_buffer::{Iter,IterMut} implementations to use a macro, so there is less duplicate code.
Inspired by the[ slice iterator macro in lib core](https://github.com/rust-lang/rust/blob/master/src/libcore/slice/mod.rs).
I have never worked with macros to generate const / mut implementations.
So this might be a little rough.
`#![allow(stable_features)]` is needed for current rust nightly, since otherwise `conservative_impl_trait` would throw a warning. Removing the feature flag would not be backwards compatible with earlier nightly versions.
Co-authored-by: Felix <stegmaier.felix@gmail.com>