Skip to content

Commit f044768

Browse files
committed
fix(napi): fix a clippy warning
1 parent 86fa77f commit f044768

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

example/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use napi::{NapiArgs, NapiEnv, NapiNumber, NapiResult, NapiUndefined};
88
#[derive(NapiArgs)]
99
struct HelloArgs;
1010

11-
fn hello(env: &NapiEnv, _: HelloArgs) -> NapiResult<NapiUndefined> {
11+
fn hello<'a>(env: &'a NapiEnv, _: &HelloArgs) -> NapiResult<NapiUndefined<'a>> {
1212
println!("Hello from the Rust land!");
1313
NapiUndefined::new(env)
1414
}
@@ -19,7 +19,7 @@ struct AddArgs<'a> {
1919
second: NapiNumber<'a>,
2020
}
2121

22-
fn add<'a>(env: &'a NapiEnv, args: AddArgs<'a>) -> NapiResult<NapiNumber<'a>> {
22+
fn add<'a>(env: &'a NapiEnv, args: &AddArgs<'a>) -> NapiResult<NapiNumber<'a>> {
2323
let first = args.first.to_i32()?;
2424
let second = args.second.to_i32()?;
2525
NapiNumber::from_i32(env, first + second)

napi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ macro_rules! napi_callback {
3838

3939
let result = <_ as NapiArgs>::from_cb_info(&env_wrapper, cb_info)
4040
.and_then(|args| {
41-
let result = $handler(&env_wrapper, args);
41+
let result = $handler(&env_wrapper, &args);
4242
typecheck_result(&result);
4343
result
4444
});

0 commit comments

Comments
 (0)