This is just my own personal Rust practice, trying to implement a lending iterator.
Check out the [lending-iterator
] crate, by the great Daniel Henry-Mantilla, for a full implementation of lending iterators (with the 'higher-kinded type' workaround/bug). The [streaming-iterator
] crate is also a great crate if you only need to iterate over a reference to an item.
Turn a lender into an iterator with cloned()
where lend is Clone
, copied()
where lend is Copy
, owned()
where lend is ToOwned
, or iter()
where lend is already owned.
Neither partition_in_place
or array_chunks
is supported by lending iterators.
I couldn't have even hoped to begin trying to use this problem as practice without relying on help from the following people and resources, please check them out:
lending-iterator
] and many other great crates and being a great teacher.Many patterns in lending iterators require polonius-emulating unsafe code, but please, if you see any unsafe code that can be made safe, please let me know! I am still learning Rust and I'm sure I've made many mistakes.
Licensed under either the MIT or Apache-2.0 license.