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

Fix merge fn closure from pr385 #481

Merged

Conversation

BoOTheFurious
Copy link
Contributor

Hello,
I 've got a use case which need to use stateful closure as merge function. As an old PR refers to my needs (PR#385 1 year old) I have rebase on current master. I have also integrated PR#480 to pass the test.
All works fine. I hope It will be accepted quickly.

Thanks @mrobakowski for the works on the initial PR.

Regards

@@ -61,16 +62,25 @@ use std::mem;
use std::ptr;
use std::slice;

pub type MergeFn = fn(&[u8], Option<&[u8]>, &mut MergeOperands) -> Option<Vec<u8>>;
//pub type MergeFn = fn(&[u8], Option<&[u8]>, &mut MergeOperands) -> Option<Vec<u8>>;
Copy link
Member

Choose a reason for hiding this comment

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

Is this comment really needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously not, it can be deleted

Choose a reason for hiding this comment

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

As I suspect things may get stuck here. I think this was a suggestion for you to update the PR @BoOTheFurious . But from your comment it seems like you expect someone else to do it 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry… I've done it

@@ -41,7 +41,8 @@
//!let mut opts = Options::default();
//!
//!opts.create_if_missing(true);
//!opts.set_merge_operator("test operator", concat_merge, None);
//!opts.set_merge_operator_associative("test operator", concat_merge);
//!//opts.set_merge_operator("test operator", concat_merge, partial_concat_merge); // if your merge is not associative
Copy link
Member

Choose a reason for hiding this comment

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

I suppose this comment could be deleted as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops…
done !

Copy link
Member

Choose a reason for hiding this comment

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

Thanks.

@aleksuss aleksuss merged commit 023dd07 into rust-rocksdb:master Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants