Skip to content

Commit

Permalink
style: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jun 10, 2022
1 parent f90d63c commit 18dc3df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions crates/backend/src/ast.rs
Expand Up @@ -40,11 +40,7 @@ pub struct NapiFnArg {
impl NapiFnArg {
/// if type was overridden with `#[napi(ts_arg_type = "...")]` use that instead
pub fn use_overridden_type_or(&self, default: impl FnOnce() -> String) -> String {
self
.ts_arg_type
.as_ref()
.map(|ts| ts.clone())
.unwrap_or_else(default)
self.ts_arg_type.as_ref().cloned().unwrap_or_else(default)
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/build/src/android.rs
Expand Up @@ -9,7 +9,7 @@ pub fn setup() -> Result<(), Error> {
let mut dist = path::PathBuf::from(&out_dir);
dist.push("libgcc.a");
let mut libgcc = fs::File::create(&dist)?;
libgcc.write(b"INPUT(-lunwind)")?;
let _ = libgcc.write(b"INPUT(-lunwind)")?;
drop(libgcc);
println!("cargo:rustc-link-search={}", &out_dir);
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion crates/build/src/lib.rs
Expand Up @@ -7,7 +7,7 @@ pub fn setup() {
Ok("macos") => {
macos::setup();
}
Ok("android") => if let Ok(_) = android::setup() {},
Ok("android") => if android::setup().is_ok() {},
_ => {}
}
}

1 comment on commit 18dc3df

@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: 18dc3df Previous: 548f358 Ratio
noop#napi-rs 41061863 ops/sec (±1.33%) 55554627 ops/sec (±0.2%) 1.35
noop#JavaScript 763883709 ops/sec (±0.88%) 713679301 ops/sec (±0.14%) 0.93
Plus number#napi-rs 15958420 ops/sec (±1.5%) 18971890 ops/sec (±0.12%) 1.19
Plus number#JavaScript 751163428 ops/sec (±0.78%) 711238235 ops/sec (±0.12%) 0.95
Create buffer#napi-rs 327832 ops/sec (±10.12%) 399925 ops/sec (±9.13%) 1.22
Create buffer#JavaScript 1602738 ops/sec (±6.57%) 1624790 ops/sec (±5.85%) 1.01
createArray#createArrayJson 34280 ops/sec (±1.07%) 37083 ops/sec (±0.12%) 1.08
createArray#create array for loop 6351 ops/sec (±0.8%) 7650 ops/sec (±0.11%) 1.20
createArray#create array with serde trait 6101 ops/sec (±1.02%) 7633 ops/sec (±0.1%) 1.25
getArrayFromJs#get array from json string 14502 ops/sec (±1.08%) 16819 ops/sec (±0.13%) 1.16
getArrayFromJs#get array from serde 8701 ops/sec (±0.78%) 10325 ops/sec (±0.13%) 1.19
getArrayFromJs#get array with for loop 9855 ops/sec (±0.92%) 12291 ops/sec (±0.06%) 1.25
Get Set property#Get Set from native#u32 352362 ops/sec (±6%) 419381 ops/sec (±5.36%) 1.19
Get Set property#Get Set from JavaScript#u32 313873 ops/sec (±5.13%) 353885 ops/sec (±5.34%) 1.13
Get Set property#Get Set from native#string 319612 ops/sec (±5.43%) 375850 ops/sec (±5.11%) 1.18
Get Set property#Get Set from JavaScript#string 292667 ops/sec (±5.34%) 338322 ops/sec (±5.13%) 1.16
Async task#spawn task 30821 ops/sec (±2.89%) 38092 ops/sec (±1.4%) 1.24
Async task#ThreadSafeFunction 2086 ops/sec (±3.52%) 1680 ops/sec (±8.75%) 0.81
Async task#Tokio future to Promise 21259 ops/sec (±2.98%) 28358 ops/sec (±1.22%) 1.33
Query#query * 100 1559 ops/sec (±1.59%) 1921 ops/sec (±1.41%) 1.23
Query#query * 1 19592 ops/sec (±2.61%) 28177 ops/sec (±1.19%) 1.44

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

Please sign in to comment.