diff options
author | Paul Masurel <paul.masurel@gmail.com> | 2017-05-19 11:12:59 +0900 |
---|---|---|
committer | Paul Masurel <paul.masurel@gmail.com> | 2017-05-19 11:20:27 +0900 |
commit | 57a5547ae814cdc5fd33e923626ef859826f5bd3 (patch) | |
tree | dd15231c43ee8e6b8baa17fe7fb3469506f1f08b /src/fastfield | |
parent | c57ab6a3354ea8e6df51b2b41152124eaaa0e322 (diff) |
Comments and cleaning up API
Diffstat (limited to 'src/fastfield')
-rw-r--r-- | src/fastfield/mod.rs | 18 | ||||
-rw-r--r-- | src/fastfield/reader.rs | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/fastfield/mod.rs b/src/fastfield/mod.rs index 84fe530..ad2988c 100644 --- a/src/fastfield/mod.rs +++ b/src/fastfield/mod.rs @@ -97,7 +97,7 @@ mod tests { assert_eq!(source.len(), 38 as usize); } { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); assert_eq!(fast_field_reader.get(0), 13u64); @@ -131,7 +131,7 @@ mod tests { assert_eq!(source.len(), 63 as usize); } { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); assert_eq!(fast_field_reader.get(0), 4u64); @@ -167,7 +167,7 @@ mod tests { assert_eq!(source.len(), 36 as usize); } { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); for doc in 0..10_000 { @@ -200,7 +200,7 @@ mod tests { assert_eq!(source.len(), 80044 as usize); } { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); assert_eq!(fast_field_reader.get(0), 0u64); @@ -237,7 +237,7 @@ mod tests { assert_eq!(source.len(), 17711 as usize); } { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: I64FastFieldReader = fast_field_readers.open_reader(i64_field).unwrap(); assert_eq!(fast_field_reader.min_value(), -100i64); @@ -268,7 +268,7 @@ mod tests { let source = directory.open_read(&path).unwrap(); { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: I64FastFieldReader = fast_field_readers.open_reader(i64_field).unwrap(); assert_eq!(fast_field_reader.get(0u32), 0i64); @@ -301,7 +301,7 @@ mod tests { } let source = directory.open_read(&path).unwrap(); { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); let mut a = 0u64; @@ -359,7 +359,7 @@ mod tests { } let source = directory.open_read(&path).unwrap(); { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); b.iter(|| { @@ -390,7 +390,7 @@ mod tests { } let source = directory.open_read(&path).unwrap(); { - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); let fast_field_reader: U64FastFieldReader = fast_field_readers.open_reader(*FIELD).unwrap(); b.iter(|| { diff --git a/src/fastfield/reader.rs b/src/fastfield/reader.rs index 7f4684f..aa30506 100644 --- a/src/fastfield/reader.rs +++ b/src/fastfield/reader.rs @@ -128,7 +128,7 @@ impl From<Vec<u64>> for U64FastFieldReader { serializer.close().unwrap(); } let source = directory.open_read(path).unwrap(); - let fast_field_readers = FastFieldsReader::open(source).unwrap(); + let fast_field_readers = FastFieldsReader::from_source(source).unwrap(); fast_field_readers.open_reader(field).unwrap() } } @@ -194,12 +194,12 @@ pub struct FastFieldsReader { } impl FastFieldsReader { - /// Opens the `FastFieldsReader` file + /// Opens a `FastFieldsReader` /// /// When opening the fast field reader, the /// the list of the offset is read (as a footer of the /// data file). - pub fn open(source: ReadOnlySource) -> io::Result<FastFieldsReader> { + pub fn from_source(source: ReadOnlySource) -> io::Result<FastFieldsReader> { let header_offset; let field_offsets: Vec<(Field, u32)>; { |