From 18dc3df5bab8c3a9d302d309996dba8717d93fcb Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 10 Jun 2022 15:20:06 +0800 Subject: [PATCH] style: clippy --- crates/backend/src/ast.rs | 6 +----- crates/build/src/android.rs | 2 +- crates/build/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index 33641687..570f0451 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -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) } } diff --git a/crates/build/src/android.rs b/crates/build/src/android.rs index e4bde877..702a3bbd 100644 --- a/crates/build/src/android.rs +++ b/crates/build/src/android.rs @@ -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(()) diff --git a/crates/build/src/lib.rs b/crates/build/src/lib.rs index 65e19611..3dd6bf16 100644 --- a/crates/build/src/lib.rs +++ b/crates/build/src/lib.rs @@ -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() {}, _ => {} } }