Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RefineFlatIndex #60

Merged
merged 6 commits into from
Dec 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/index/refine_flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<BI> NativeIndex for RefineFlatIndexImpl<BI> {
}
}

impl<BI> FromInnerPtr for RefineFlatIndexImpl<BI> {
impl<IndexImpl> FromInnerPtr for RefineFlatIndexImpl<IndexImpl> {
ava57r marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Owner

@Enet4 Enet4 Nov 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
impl<IndexImpl> FromInnerPtr for RefineFlatIndexImpl<IndexImpl> {
impl FromInnerPtr for RefineFlatIndexImpl<IndexImpl> {

unsafe fn from_inner_ptr(inner_ptr: *mut FaissIndex) -> Self {
RefineFlatIndexImpl {
inner: inner_ptr as *mut FaissIndexFlat,
Expand All @@ -80,7 +80,7 @@ impl<BI> FromInnerPtr for RefineFlatIndexImpl<BI> {
}
}

impl<BI> TryFromInnerPtr for RefineFlatIndexImpl<BI> {
impl<IndexImpl> TryFromInnerPtr for RefineFlatIndexImpl<IndexImpl> {
ava57r marked this conversation as resolved.
Show resolved Hide resolved
unsafe fn try_from_inner_ptr(inner_ptr: *mut FaissIndex) -> Result<Self>
where
Self: Sized,
Expand All @@ -93,7 +93,10 @@ impl<BI> TryFromInnerPtr for RefineFlatIndexImpl<BI> {
if new_inner.is_null() {
Err(Error::BadCast)
} else {
Ok(RefineFlatIndexImpl { inner: new_inner, base_index: PhantomData })
Ok(RefineFlatIndexImpl {
inner: new_inner,
base_index: PhantomData,
})
}
}
}
Expand Down