Dont borrow again (#5499)
This commit is contained in:
1 parent
8f5c4d9f25
commit
cb8359a99b
1 file changed
+7
-7
@@ -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! {
|
||||||
|
|||||||
Reference in new issue
Block a user