fix: rename close_db_connection to flush (#192)

This commit is contained in:
Aaryamann Challani 2023-07-26 11:20:33 +05:30 committed by GitHub
parent 5cf2b2e05e
commit 9d4ed68450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -1134,7 +1134,7 @@ impl RLN<'_> {
/// This function should be called before the RLN object is dropped. /// 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. /// If not called, the connection will be closed when the RLN object is dropped.
/// This improves robustness of the tree. /// 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() self.tree.close_db_connection()
} }
} }
@ -1387,7 +1387,7 @@ mod test {
assert_eq!(root_batch_with_init, root_single_additions); assert_eq!(root_batch_with_init, root_single_additions);
rln.close_db_connection(); rln.flush();
} }
#[test] #[test]