https://github.com/coriolinus/insert_multiple
https://github.com/coriolinus/insert_multiple
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/coriolinus/insert_multiple
- Owner: coriolinus
- Created: 2018-11-05T22:26:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-06T00:04:29.000Z (over 7 years ago)
- Last Synced: 2025-03-01T13:46:14.972Z (over 1 year ago)
- Language: Rust
- Homepage: https://crates.io/crates/insert_multiple
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `insert_multiple`: insert multiple items into a stream
The scenario: you have an input stream, and you know you wish to insert a number
of items into this stream at known offsets.
If your stream is a `String` or a `Vec` or similar, you shouldn't do this naively:
performance is `O(n**2)`, and you have to care about looping backwards through the
input stream to preserve your offsets.
This crate supports this use case in `O(n)`.