ripgrep-all/src/recurse.rs

17 lines
458 B
Rust
Raw Normal View History

2022-10-29 18:54:05 +00:00
use tokio_util::io::{ReaderStream, StreamReader};
2020-09-30 15:26:42 +00:00
use crate::{adapted_iter::AdaptedFilesIterBox, adapters::*};
2022-10-29 18:54:05 +00:00
use async_stream::stream;
2020-09-30 14:22:54 +00:00
2022-12-05 03:30:56 +00:00
pub fn concat_read_streams(input: AdaptedFilesIterBox) -> ReadBox {
2022-10-29 18:54:05 +00:00
let s = stream! {
2022-10-30 00:34:56 +00:00
for await output in input {
let stream = ReaderStream::new(output.inp);
for await bytes in stream {
2022-10-29 18:54:05 +00:00
yield bytes;
}
}
};
Box::pin(StreamReader::new(s))
2022-12-05 03:30:56 +00:00
}