| Crates.io | circular_vec |
| lib.rs | circular_vec |
| version | 0.1.1 |
| created_at | 2021-07-24 00:24:57.420369+00 |
| updated_at | 2021-07-24 01:31:06.217062+00 |
| description | A fixed length vector that provides a next function that loops infinitely |
| homepage | |
| repository | https://github.com/banool/circular_vec |
| max_upload_size | |
| id | 426557 |
| size | 5,716 |
This provides a struct called CircularVec. It is a fixed length Vec that provides a next function, which iterates through the vec. When it hits the end, instead of returning None, we just loop back to the start.
Note: This struct could use a lot of love. While I do have a need for this struct, and I use this for a personal project, this is also to become familiar with publishing a crate to crates.io. See the many ways this could be improved below.
next function.