Skip to content

Commit 12bd685

Browse files
committed
Fix lints
1 parent 7326e35 commit 12bd685

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

rust/src/api/instance.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,25 +207,25 @@ impl<'a> ChainableInstance<'a> {
207207
&self,
208208
method_name: &str,
209209
inv_args: &[InvocationArg],
210-
) -> errors::Result<ChainableInstance> {
210+
) -> errors::Result<ChainableInstance<'_>> {
211211
let instance = self.jvm.invoke(&self.instance, method_name, inv_args)?;
212212
Ok(ChainableInstance::new(instance, self.jvm))
213213
}
214214

215215
/// Creates a clone of the Instance
216-
pub fn clone_instance(&self) -> errors::Result<ChainableInstance> {
216+
pub fn clone_instance(&self) -> errors::Result<ChainableInstance<'_>> {
217217
let instance = self.jvm.clone_instance(&self.instance)?;
218218
Ok(ChainableInstance::new(instance, self.jvm))
219219
}
220220

221221
/// Invokes the static method `method_name` of the class `class_name`, passing an array of `InvocationArg`s. It returns an `Instance` as the result of the invocation.
222-
pub fn cast(&self, to_class: &str) -> errors::Result<ChainableInstance> {
222+
pub fn cast(&self, to_class: &str) -> errors::Result<ChainableInstance<'_>> {
223223
let instance = self.jvm.cast(&self.instance, to_class)?;
224224
Ok(ChainableInstance::new(instance, self.jvm))
225225
}
226226

227227
/// Retrieves the field `field_name` of the `Instance`.
228-
pub fn field(&self, field_name: &str) -> errors::Result<ChainableInstance> {
228+
pub fn field(&self, field_name: &str) -> errors::Result<ChainableInstance<'_>> {
229229
let instance = self.jvm.field(&self.instance, field_name)?;
230230
Ok(ChainableInstance::new(instance, self.jvm))
231231
}

rust/src/api/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,12 +1505,12 @@ impl Jvm {
15051505
}
15061506

15071507
/// Initiates a chain of operations on Instances.
1508-
pub fn chain(&self, instance: &Instance) -> errors::Result<ChainableInstance> {
1508+
pub fn chain(&self, instance: &Instance) -> errors::Result<ChainableInstance<'_>> {
15091509
ChainableInstance::new_with_instance_ref(instance, self)
15101510
}
15111511

15121512
/// Initiates a chain of operations on Instances.
1513-
pub fn into_chain(&self, instance: Instance) -> ChainableInstance {
1513+
pub fn into_chain(&self, instance: Instance) -> ChainableInstance<'_> {
15141514
ChainableInstance::new(instance, self)
15151515
}
15161516

@@ -2111,7 +2111,7 @@ pub enum Null<'a> {
21112111
pub struct ClasspathEntry<'a>(&'a str);
21122112

21132113
impl<'a> ClasspathEntry<'a> {
2114-
pub fn new(classpath_entry: &str) -> ClasspathEntry {
2114+
pub fn new(classpath_entry: &str) -> ClasspathEntry<'_> {
21152115
ClasspathEntry(classpath_entry)
21162116
}
21172117
}
@@ -2127,7 +2127,7 @@ impl<'a> ToString for ClasspathEntry<'a> {
21272127
pub struct JavaOpt<'a>(&'a str);
21282128

21292129
impl<'a> JavaOpt<'a> {
2130-
pub fn new(java_opt: &str) -> JavaOpt {
2130+
pub fn new(java_opt: &str) -> JavaOpt<'_> {
21312131
JavaOpt(java_opt)
21322132
}
21332133
}

rust/src/api_tweaks/generic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use jni_sys::{jclass, jint, jsize, JNIEnv, JavaVM};
1919

2020
use crate::{errors, utils};
2121

22+
#[allow(non_snake_case)]
2223
type JNIGetCreatedJavaVMs =
2324
unsafe extern "system" fn(vmBuf: *mut *mut JavaVM, bufLen: jsize, nVMs: *mut jsize) -> jint;
2425

0 commit comments

Comments
 (0)