From eaa8743c3603f9c15282c06d810b272af79a8b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=84=A0=EC=9A=B0?= Date: Sat, 18 Jan 2025 09:16:09 +0900 Subject: [PATCH] Nit --- Cargo.lock | 2 +- bindings/java/rs_src/limbo_connection.rs | 15 +-------------- bindings/java/rs_src/limbo_db.rs | 7 ++----- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e94c673e5..ac3b51486 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,7 +1064,7 @@ version = "0.0.12" dependencies = [ "jni", "limbo_core", - "thiserror 2.0.9", + "thiserror 2.0.11", ] [[package]] diff --git a/bindings/java/rs_src/limbo_connection.rs b/bindings/java/rs_src/limbo_connection.rs index f2000e481..1399d8b42 100644 --- a/bindings/java/rs_src/limbo_connection.rs +++ b/bindings/java/rs_src/limbo_connection.rs @@ -11,6 +11,7 @@ use limbo_core::Connection; use std::rc::Rc; #[derive(Clone)] +#[allow(dead_code)] pub struct LimboConnection { pub(crate) conn: Rc, pub(crate) io: Rc, @@ -39,20 +40,6 @@ pub fn to_limbo_connection(ptr: jlong) -> Result<&'static mut LimboConnection> { } } -/// Returns a pointer to a `Cursor` object. -/// -/// The Java application will pass this pointer to native functions, -/// which will use it to reference the `Cursor` object. -/// -/// # Arguments -/// -/// * `_env` - The JNI environment pointer. -/// * `_class` - The Java class calling this function. -/// * `connection_ptr` - A pointer to the `Connection` object. -/// -/// # Returns -/// -/// A `jlong` representing the pointer to the newly created `Cursor` object. #[no_mangle] pub extern "system" fn Java_org_github_tursodatabase_core_LimboConnection_prepareUtf8<'local>( mut env: JNIEnv<'local>, diff --git a/bindings/java/rs_src/limbo_db.rs b/bindings/java/rs_src/limbo_db.rs index cebdb7614..09d8afa75 100644 --- a/bindings/java/rs_src/limbo_db.rs +++ b/bindings/java/rs_src/limbo_db.rs @@ -1,12 +1,12 @@ use crate::errors::{LimboError, Result, LIMBO_ETC}; use crate::limbo_connection::LimboConnection; +use crate::utils::set_err_msg_and_throw_exception; use jni::objects::{JByteArray, JObject}; use jni::sys::{jint, jlong}; use jni::JNIEnv; use limbo_core::Database; use std::rc::Rc; use std::sync::Arc; -use crate::utils::set_err_msg_and_throw_exception; struct LimboDB { db: Arc, @@ -127,10 +127,7 @@ pub extern "system" fn Java_org_github_tursodatabase_core_LimboDB_connect0<'loca } }, }; - let conn = LimboConnection::new( - db.db.connect(), - io, - ); + let conn = LimboConnection::new(db.db.connect(), io); conn.to_ptr() }