Skip to content

Commit

Permalink
chore: allow uninlined_format_args in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 28, 2023
1 parent aed2540 commit 3e92765
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bench/src/lib.rs
@@ -1,3 +1,5 @@
#![allow(clippy::uninlined_format_args)]

#[macro_use]
extern crate napi_derive;

Expand Down
4 changes: 2 additions & 2 deletions crates/napi/src/env.rs
Expand Up @@ -357,7 +357,7 @@ impl Env {
&mut raw_value,
);
data = result_data.cast();
finalize(hint, self.clone());
finalize(hint, *self);
check_status!(status)?;
} else {
check_status!(status)?;
Expand Down Expand Up @@ -520,7 +520,7 @@ impl Env {
let status =
sys::napi_create_arraybuffer(self.0, length, &mut underlying_data, &mut raw_value);
data = underlying_data.cast();
finalize(hint, self.clone());
finalize(hint, *self);
check_status!(status)?;
} else {
check_status!(status)?;
Expand Down
1 change: 1 addition & 0 deletions examples/napi-compat-mode/src/lib.rs
@@ -1,4 +1,5 @@
#![allow(unused_variables)]
#![allow(clippy::uninlined_format_args)]

#[macro_use]
extern crate napi_derive;
Expand Down
1 change: 1 addition & 0 deletions examples/napi/src/lib.rs
@@ -1,6 +1,7 @@
#![allow(dead_code)]
#![allow(unreachable_code)]
#![allow(clippy::disallowed_names)]
#![allow(clippy::uninlined_format_args)]

#[macro_use]
extern crate napi_derive;
Expand Down

1 comment on commit 3e92765

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 3e92765 Previous: fde2d64 Ratio
noop#napi-rs 54096460 ops/sec (±0.76%) 64268786 ops/sec (±0.27%) 1.19
noop#JavaScript 733730848 ops/sec (±0.96%) 710252276 ops/sec (±0.1%) 0.97
Plus number#napi-rs 15088959 ops/sec (±1.02%) 19701768 ops/sec (±0.6%) 1.31
Plus number#JavaScript 714174863 ops/sec (±0.89%) 708450052 ops/sec (±0.14%) 0.99
Create buffer#napi-rs 299629 ops/sec (±11.55%) 365131 ops/sec (±10.52%) 1.22
Create buffer#JavaScript 1553417 ops/sec (±5.82%) 1769743 ops/sec (±6.98%) 1.14
createArray#createArrayJson 35457 ops/sec (±0.68%) 38725 ops/sec (±0.11%) 1.09
createArray#create array for loop 6061 ops/sec (±0.6%) 7410 ops/sec (±0.12%) 1.22
createArray#create array with serde trait 5950 ops/sec (±1.34%) 7427 ops/sec (±0.12%) 1.25
getArrayFromJs#get array from json string 15012 ops/sec (±0.88%) 16367 ops/sec (±0.27%) 1.09
getArrayFromJs#get array from serde 8311 ops/sec (±0.59%) 10023 ops/sec (±0.04%) 1.21
getArrayFromJs#get array with for loop 10553 ops/sec (±0.65%) 12256 ops/sec (±0.1%) 1.16
Get Set property#Get Set from native#u32 361888 ops/sec (±6.77%) 415294 ops/sec (±6.57%) 1.15
Get Set property#Get Set from JavaScript#u32 303393 ops/sec (±6.88%) 357080 ops/sec (±6.76%) 1.18
Get Set property#Get Set from native#string 333950 ops/sec (±6.44%) 368692 ops/sec (±6.5%) 1.10
Get Set property#Get Set from JavaScript#string 304171 ops/sec (±6.8%) 341740 ops/sec (±6.86%) 1.12
Async task#spawn task 31149 ops/sec (±1.62%) 37096 ops/sec (±1.46%) 1.19
Async task#ThreadSafeFunction 1818 ops/sec (±3.36%) 1140 ops/sec (±23.02%) 0.63
Async task#Tokio future to Promise 27086 ops/sec (±1.93%) 31816 ops/sec (±0.65%) 1.17
Query#query * 100 1542 ops/sec (±2.43%) 2058 ops/sec (±3.31%) 1.33
Query#query * 1 22543 ops/sec (±1.43%) 31192 ops/sec (±0.3%) 1.38

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.