mirror of
https://github.com/hexedtech/jni-toolbox.git
synced 2024-11-22 07:24:53 +01:00
fix: inline more
This commit is contained in:
parent
a5befdc481
commit
358586c513
1 changed files with 4 additions and 0 deletions
|
@ -14,6 +14,7 @@ macro_rules! auto_into_java {
|
||||||
impl<'j> IntoJava<'j> for $t {
|
impl<'j> IntoJava<'j> for $t {
|
||||||
type Ret = $j;
|
type Ret = $j;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn into_java(self, _: &mut jni::JNIEnv<'j>) -> Result<Self::Ret, jni::errors::Error> {
|
fn into_java(self, _: &mut jni::JNIEnv<'j>) -> Result<Self::Ret, jni::errors::Error> {
|
||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
@ -43,6 +44,7 @@ impl<'j> IntoJava<'j> for bool {
|
||||||
impl<'j, X: IntoJavaObject<'j>> IntoJava<'j> for X {
|
impl<'j, X: IntoJavaObject<'j>> IntoJava<'j> for X {
|
||||||
type Ret = jni::sys::jobject;
|
type Ret = jni::sys::jobject;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn into_java(self, env: &mut jni::JNIEnv<'j>) -> Result<Self::Ret, jni::errors::Error> {
|
fn into_java(self, env: &mut jni::JNIEnv<'j>) -> Result<Self::Ret, jni::errors::Error> {
|
||||||
Ok(self.into_java_object(env)?.as_raw())
|
Ok(self.into_java_object(env)?.as_raw())
|
||||||
}
|
}
|
||||||
|
@ -58,6 +60,7 @@ pub trait IntoJavaObject<'j> {
|
||||||
|
|
||||||
impl<'j> IntoJavaObject<'j> for JObject<'j> {
|
impl<'j> IntoJavaObject<'j> for JObject<'j> {
|
||||||
const CLASS: &'static str = "java/lang/Object";
|
const CLASS: &'static str = "java/lang/Object";
|
||||||
|
#[inline]
|
||||||
fn into_java_object(self, _: &mut jni::JNIEnv<'j>) -> Result<JObject<'j>, jni::errors::Error> {
|
fn into_java_object(self, _: &mut jni::JNIEnv<'j>) -> Result<JObject<'j>, jni::errors::Error> {
|
||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
@ -67,6 +70,7 @@ macro_rules! auto_into_java_object {
|
||||||
($t:ty, $cls:literal) => {
|
($t:ty, $cls:literal) => {
|
||||||
impl<'j> IntoJavaObject<'j> for $t {
|
impl<'j> IntoJavaObject<'j> for $t {
|
||||||
const CLASS: &'static str = $cls;
|
const CLASS: &'static str = $cls;
|
||||||
|
#[inline]
|
||||||
fn into_java_object(self, _: &mut jni::JNIEnv<'j>) -> Result<JObject<'j>, jni::errors::Error> {
|
fn into_java_object(self, _: &mut jni::JNIEnv<'j>) -> Result<JObject<'j>, jni::errors::Error> {
|
||||||
Ok(self.into())
|
Ok(self.into())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue