summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2016-09-10 00:08:42 -0400
committerAndrew Gallant <jamslam@gmail.com>2016-09-10 00:08:42 -0400
commite3da7268362efe120d3a6ea6a68d92d1ee342842 (patch)
tree3f303ded2233cdf7d132ef95461d40a497b7e8c2
parent5b36c86c15933a6f55fd4d49712461c263a3de1c (diff)
Rename search module to search_stream.
The name better reflects the difference between it and the search_buffer module.
-rw-r--r--src/args.rs2
-rw-r--r--src/main.rs4
-rw-r--r--src/search_buffer.rs10
-rw-r--r--src/search_stream.rs (renamed from src/search.rs)5
4 files changed, 15 insertions, 6 deletions
diff --git a/src/args.rs b/src/args.rs
index 0341cef7..964e87a1 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -17,8 +17,8 @@ use gitignore::{Gitignore, GitignoreBuilder};
use ignore::Ignore;
use out::{Out, OutBuffer};
use printer::Printer;
-use search::{InputBuffer, Searcher};
use search_buffer::BufferSearcher;
+use search_stream::{InputBuffer, Searcher};
use types::{FileTypeDef, Types, TypesBuilder};
use walk;
diff --git a/src/main.rs b/src/main.rs
index 46ff894d..6666a6c0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -41,7 +41,7 @@ use walkdir::DirEntry;
use args::Args;
use out::{NoColorTerminal, Out, OutBuffer};
use printer::Printer;
-use search::InputBuffer;
+use search_stream::InputBuffer;
macro_rules! errored {
($($tt:tt)*) => {
@@ -63,8 +63,8 @@ mod glob;
mod ignore;
mod out;
mod printer;
-mod search;
mod search_buffer;
+mod search_stream;
mod terminal;
mod types;
mod walk;
diff --git a/src/search_buffer.rs b/src/search_buffer.rs
index fc8cd3a1..d91c1a82 100644
--- a/src/search_buffer.rs
+++ b/src/search_buffer.rs
@@ -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::path::Path;
@@ -5,7 +13,7 @@ use grep::Grep;
use term::Terminal;
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> {
opts: Options,
diff --git a/src/search.rs b/src/search_stream.rs
index 027bd0d3..08f70184 100644
--- a/src/search.rs
+++ b/src/search_stream.rs
@@ -1,6 +1,7 @@
/*!
-The search module is responsible for searching a single file and printing
-matches.
+The search_stream module is responsible for searching a single file and
+printing matches. In particular, it searches the file in a streaming fashion
+using `read` calls and a (roughly) fixed size buffer.
*/
use std::cmp;