mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-24 20:24:57 +00:00
19 lines
465 B
Rust
19 lines
465 B
Rust
use tokio_util::io::{ReaderStream, StreamReader};
|
|
|
|
use crate::{adapted_iter::AdaptedFilesIterBox, adapters::*};
|
|
use async_stream::stream;
|
|
|
|
|
|
pub fn concat_read_streams(
|
|
input: AdaptedFilesIterBox,
|
|
) -> ReadBox {
|
|
let s = stream! {
|
|
for await output in input {
|
|
let stream = ReaderStream::new(output.inp);
|
|
for await bytes in stream {
|
|
yield bytes;
|
|
}
|
|
}
|
|
};
|
|
Box::pin(StreamReader::new(s))
|
|
} |