Rename search module to search_stream.

The name better reflects the difference between it and the search_buffer
module.
This commit is contained in:
Andrew Gallant 2016-09-10 00:08:42 -04:00
parent 5b36c86c15
commit e3da726836
4 changed files with 15 additions and 6 deletions

View File

@ -17,8 +17,8 @@ use gitignore::{Gitignore, GitignoreBuilder};
use ignore::Ignore; use ignore::Ignore;
use out::{Out, OutBuffer}; use out::{Out, OutBuffer};
use printer::Printer; use printer::Printer;
use search::{InputBuffer, Searcher};
use search_buffer::BufferSearcher; use search_buffer::BufferSearcher;
use search_stream::{InputBuffer, Searcher};
use types::{FileTypeDef, Types, TypesBuilder}; use types::{FileTypeDef, Types, TypesBuilder};
use walk; use walk;

View File

@ -41,7 +41,7 @@ use walkdir::DirEntry;
use args::Args; use args::Args;
use out::{NoColorTerminal, Out, OutBuffer}; use out::{NoColorTerminal, Out, OutBuffer};
use printer::Printer; use printer::Printer;
use search::InputBuffer; use search_stream::InputBuffer;
macro_rules! errored { macro_rules! errored {
($($tt:tt)*) => { ($($tt:tt)*) => {
@ -63,8 +63,8 @@ mod glob;
mod ignore; mod ignore;
mod out; mod out;
mod printer; mod printer;
mod search;
mod search_buffer; mod search_buffer;
mod search_stream;
mod terminal; mod terminal;
mod types; mod types;
mod walk; mod walk;

View File

@ -1,3 +1,11 @@
/*!
The search_buffer module is responsible for searching a single file all in a
single buffer. Typically, the source of the buffer is a memory map. This can
be useful for when memory maps are faster than streaming search.
Note that this module doesn't quite support everything that search_stream does.
Notably, showing contexts.
*/
use std::cmp; use std::cmp;
use std::path::Path; use std::path::Path;
@ -5,7 +13,7 @@ use grep::Grep;
use term::Terminal; use term::Terminal;
use printer::Printer; use printer::Printer;
use search::{IterLines, Options, count_lines, is_binary}; use search_stream::{IterLines, Options, count_lines, is_binary};
pub struct BufferSearcher<'a, W: 'a> { pub struct BufferSearcher<'a, W: 'a> {
opts: Options, opts: Options,

View File

@ -1,6 +1,7 @@
/*! /*!
The search module is responsible for searching a single file and printing The search_stream module is responsible for searching a single file and
matches. printing matches. In particular, it searches the file in a streaming fashion
using `read` calls and a (roughly) fixed size buffer.
*/ */
use std::cmp; use std::cmp;