Skip to content

Commit ae9e854

Browse files
irevoireKerollmops
andcommitted
Apply suggestions from code review
Co-authored-by: Clément Renault <[email protected]>
1 parent 0cb2900 commit ae9e854

File tree

4 files changed

+3
-6
lines changed

4 files changed

+3
-6
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub enum Error {
4343
/// Arroy is not able to find the metadata for a given index.
4444
/// It is probably because the user forget to build the database.
4545
#[error(
46-
"Metadata are missing on index {0}, did you build your database before trying to read it"
46+
"Metadata are missing on index {0}, You must build your database before attempting to read it"
4747
)]
4848
MissingMetadata(u16),
4949

src/reader.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ impl<'t, D: Distance> Reader<'t, D> {
4545
received: D::name(),
4646
});
4747
}
48-
let need_build =
49-
database.remap_data_type::<Bytes>().get(rtxn, &Key::updated(index))?.is_some();
50-
if need_build {
48+
if database.remap_data_type::<Bytes>().get(rtxn, &Key::updated(index))?.is_some() {
5149
return Err(Error::NeedBuild(index));
5250
}
5351

src/tests/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn open_unfinished_db() {
3434

3535
let rtxn = handle.env.read_txn().unwrap();
3636
let ret = Reader::<Euclidean>::open(&rtxn, 0, handle.database).map(|_| ()).unwrap_err();
37-
insta::assert_display_snapshot!(ret, @"Metadata are missing on index 0, did you build your database before trying to read it");
37+
insta::assert_display_snapshot!(ret, @"Metadata are missing on index 0, You must build your database before attempting to read it");
3838
}
3939

4040
#[test]

src/tests/writer.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ fn write_one_vector() {
9595

9696
#[test]
9797
fn write_one_vector_in_one_tree() {
98-
let _ = env_logger::builder().is_test(true).parse_filters("trace").try_init();
9998
let handle = create_database::<Euclidean>();
10099
let mut wtxn = handle.env.write_txn().unwrap();
101100
let writer = Writer::new(handle.database, 0, 3);

0 commit comments

Comments
 (0)