From 67cd81701d864cd98790b7d5ef01039f02309818 Mon Sep 17 00:00:00 2001 From: LastLeaf Date: Thu, 26 Dec 2024 17:07:07 +0800 Subject: [PATCH] fix: remove clippy warning --- float-pigment-css/Cargo.toml | 1 + float-pigment-css/README.md | 2 +- float-pigment-css/src/lib.rs | 5 +++-- float-pigment-css/src/property.rs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/float-pigment-css/Cargo.toml b/float-pigment-css/Cargo.toml index 7cf5203..6f74fb2 100644 --- a/float-pigment-css/Cargo.toml +++ b/float-pigment-css/Cargo.toml @@ -39,6 +39,7 @@ default = ["std", "deserialize", "serialize", "ffi"] std = ["serde/std", "serde_json/std", "bit-set/std", "num-traits/std", "half/std", "float-pigment-consistent-bincode/std"] no-std-lock = [] wasm-entrance = ["wasm-bindgen", "console_log", "console_error_panic_hook", "js-sys"] +nodejs-package = ["wasm-entrance"] build-cpp-header = ["cbindgen", "fs_extra"] serialize = [] deserialize = [] diff --git a/float-pigment-css/README.md b/float-pigment-css/README.md index feb0323..1809b66 100644 --- a/float-pigment-css/README.md +++ b/float-pigment-css/README.md @@ -14,7 +14,7 @@ But more, this module can be compiled to WebAssembly itself, and can be called f With [wasm-pack](https://github.com/rustwasm/wasm-pack) installed globally: ```shell -wasm-pack build float-pigment-css --target nodejs --features wasm-entrance +wasm-pack build float-pigment-css --target nodejs --features nodejs-package ``` diff --git a/float-pigment-css/src/lib.rs b/float-pigment-css/src/lib.rs index 45dfba3..8bb8af7 100644 --- a/float-pigment-css/src/lib.rs +++ b/float-pigment-css/src/lib.rs @@ -58,7 +58,7 @@ pub mod parser; #[cfg(debug_assertions)] use check_trait::CompatibilityCheck; -#[cfg(all(target_arch = "wasm32", feature = "wasm-entrance"))] +#[cfg(all(target_arch = "wasm32", feature = "nodejs-package"))] fn init_logger() { use std::sync::Once; static INIT: Once = Once::new(); @@ -67,7 +67,8 @@ fn init_logger() { }); } -#[cfg(all(target_arch = "wasm32", feature = "wasm-entrance"))] +#[doc(hidden)] +#[cfg(all(target_arch = "wasm32", feature = "nodejs-package"))] #[wasm_bindgen(start)] pub fn wasm_main() { init_logger(); diff --git a/float-pigment-css/src/property.rs b/float-pigment-css/src/property.rs index 30ad04d..e54f9a5 100644 --- a/float-pigment-css/src/property.rs +++ b/float-pigment-css/src/property.rs @@ -343,7 +343,7 @@ property_value_format! (PropertyValueWithGlobal, { if let Some(column_gap) = column_gap { return (row_gap, column_gap); } - return (row_gap.clone(), row_gap); + (row_gap.clone(), row_gap) }; }}; flex_grow: {{ FlexGrow = }};