diff --git a/rln/src/ffi.rs b/rln/src/ffi.rs index 81dce61..a8a76d5 100644 --- a/rln/src/ffi.rs +++ b/rln/src/ffi.rs @@ -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)] diff --git a/rln/src/public.rs b/rln/src/public.rs index d32a4b4..e54d157 100644 --- a/rln/src/public.rs +++ b/rln/src/public.rs @@ -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() } } @@ -1387,7 +1387,7 @@ mod test { assert_eq!(root_batch_with_init, root_single_additions); - rln.close_db_connection(); + rln.flush(); } #[test]