Dont borrow again (#5499)

This commit is contained in:
Lukas Kreussel authored and GitHub committed 2026-04-21 13:59:12 -07:00
1 parent 8f5c4d9f25
commit cb8359a99b
1 file changed
+7 -7
+7 -7
View File
@@ -502,31 +502,31 @@ impl FfiBridgeParser {
let (binding, arg_expr) = match &arg.ty { let (binding, arg_expr) = match &arg.ty {
ForeignType::Bool => ( ForeignType::Bool => (
quote! { let #binding_name = manganis::jni::objects::JValue::Bool(if #name { 1 } else { 0 }); }, quote! { let #binding_name = manganis::jni::objects::JValue::Bool(if #name { 1 } else { 0 }); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::I8 | ForeignType::U8 => ( ForeignType::I8 | ForeignType::U8 => (
quote! { let #binding_name = manganis::jni::objects::JValue::Byte(#name as i8); }, quote! { let #binding_name = manganis::jni::objects::JValue::Byte(#name as i8); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::I16 | ForeignType::U16 => ( ForeignType::I16 | ForeignType::U16 => (
quote! { let #binding_name = manganis::jni::objects::JValue::Short(#name as i16); }, quote! { let #binding_name = manganis::jni::objects::JValue::Short(#name as i16); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::I32 | ForeignType::U32 => ( ForeignType::I32 | ForeignType::U32 => (
quote! { let #binding_name = manganis::jni::objects::JValue::Int(#name as i32); }, quote! { let #binding_name = manganis::jni::objects::JValue::Int(#name as i32); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::I64 | ForeignType::U64 => ( ForeignType::I64 | ForeignType::U64 => (
quote! { let #binding_name = manganis::jni::objects::JValue::Long(#name as i64); }, quote! { let #binding_name = manganis::jni::objects::JValue::Long(#name as i64); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::F32 => ( ForeignType::F32 => (
quote! { let #binding_name = manganis::jni::objects::JValue::Float(#name); }, quote! { let #binding_name = manganis::jni::objects::JValue::Float(#name); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::F64 => ( ForeignType::F64 => (
quote! { let #binding_name = manganis::jni::objects::JValue::Double(#name); }, quote! { let #binding_name = manganis::jni::objects::JValue::Double(#name); },
quote! { #binding_name.borrow() }, quote! { #binding_name },
), ),
ForeignType::String | ForeignType::StrRef => ( ForeignType::String | ForeignType::StrRef => (
quote! { quote! {