Skip to content

Commit

Permalink
fix: rename close_db_connection to flush (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
rymnc authored Jul 26, 2023
1 parent 5cf2b2e commit 9d4ed68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rln/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ pub extern "C" fn get_metadata(ctx: *const RLN, output_buffer: *mut Buffer) -> b

#[allow(clippy::not_unsafe_ptr_arg_deref)]
#[no_mangle]
pub extern "C" fn close_db_connection(ctx: *mut RLN) -> bool {
call!(ctx, close_db_connection)
pub extern "C" fn flush(ctx: *mut RLN) -> bool {
call!(ctx, flush)
}

#[allow(clippy::not_unsafe_ptr_arg_deref)]
Expand Down
4 changes: 2 additions & 2 deletions rln/src/public.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ impl RLN<'_> {
/// This function should be called before the RLN object is dropped.
/// If not called, the connection will be closed when the RLN object is dropped.
/// This improves robustness of the tree.
pub fn close_db_connection(&mut self) -> Result<()> {
pub fn flush(&mut self) -> Result<()> {
self.tree.close_db_connection()
}
}
Expand Down Expand Up @@ -1387,7 +1387,7 @@ mod test {

assert_eq!(root_batch_with_init, root_single_additions);

rln.close_db_connection();
rln.flush();
}

#[test]
Expand Down

0 comments on commit 9d4ed68

Please sign in to comment.