Skip to content

Commit 44b732d

Browse files
committed
apply review comment
1 parent 3754f7b commit 44b732d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/reader.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,10 @@ impl<'t, D: Distance> Reader<'t, D> {
382382
let mut nns_distances = Vec::with_capacity(nns.len());
383383
for nn in nns {
384384
let key = Key::item(self.index, nn);
385-
let leaf = match self.database_get(rtxn, &key)?.ok_or(Error::missing_key(key))? {
386-
GenericReadNode::Leaf(leaf) => leaf,
387-
GenericReadNode::Descendants(_) | GenericReadNode::SplitPlaneNormal(_) => {
388-
unreachable!()
389-
}
385+
let GenericReadNode::Leaf(leaf) =
386+
self.database_get(rtxn, &key)?.ok_or(Error::missing_key(key))?
387+
else {
388+
unreachable!()
390389
};
391390
let distance = D::built_distance(query_leaf, &leaf);
392391
nns_distances.push(Reverse((OrderedFloat(distance), nn)));

0 commit comments

Comments
 (0)