Stream results when feasible.

For example, when only a single file (or stdin) is being searched, then we
should be able to print directly to the terminal instead of intermediate
buffers. (The buffers are only necessary for parallelism.)

Closes #4.
This commit is contained in:
Andrew Gallant
2016-09-13 21:11:46 -04:00
parent f11d9fb922
commit fdca74148d
12 changed files with 493 additions and 650 deletions

View File

@@ -36,7 +36,7 @@ pub struct Printer<W> {
with_filename: bool,
}
impl<W: Send + Terminal> Printer<W> {
impl<W: Terminal + Send> Printer<W> {
/// Create a new printer that writes to wtr.
pub fn new(wtr: W) -> Printer<W> {
Printer {