From 9cc05e565bc87e467c66bfd9e488eddd434029e1 Mon Sep 17 00:00:00 2001 From: naskya Date: Sat, 27 Jan 2024 07:09:28 +0900 Subject: [PATCH] chore: remove `cfg_attr`s for napi, which are no longer needed --- packages/backend-rs/src/config/environment.rs | 4 ++-- packages/backend-rs/src/config/server.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/backend-rs/src/config/environment.rs b/packages/backend-rs/src/config/environment.rs index b38d21e99..cdb1d19fd 100644 --- a/packages/backend-rs/src/config/environment.rs +++ b/packages/backend-rs/src/config/environment.rs @@ -1,4 +1,4 @@ -#[cfg_attr(feature = "napi", napi_derive::napi)] +#[napi_derive::napi] pub struct EnvConfig { pub only_queue: bool, pub only_server: bool, @@ -10,7 +10,7 @@ pub struct EnvConfig { pub slow: bool, } -#[cfg_attr(feature = "napi", napi_derive::napi)] +#[napi_derive::napi] pub fn read_environment_config() -> EnvConfig { let node_env = std::env::var("NODE_ENV").unwrap_or_default().to_lowercase(); let is_testing = node_env == "test" || node_env == "testing"; diff --git a/packages/backend-rs/src/config/server.rs b/packages/backend-rs/src/config/server.rs index f9adc54d3..ba754f408 100644 --- a/packages/backend-rs/src/config/server.rs +++ b/packages/backend-rs/src/config/server.rs @@ -5,7 +5,7 @@ use std::fs; #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct ServerConfig { pub url: String, pub db: DbConfig, @@ -14,7 +14,7 @@ pub struct ServerConfig { } #[derive(Debug, PartialEq, Deserialize)] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct DbConfig { pub host: String, pub port: u32, @@ -24,7 +24,7 @@ pub struct DbConfig { } #[derive(Debug, PartialEq, Deserialize)] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct RedisConfig { pub host: String, pub port: u32, @@ -39,13 +39,13 @@ pub struct RedisConfig { #[derive(Debug, PartialEq, Deserialize)] #[serde(rename_all = "camelCase")] -#[cfg_attr(feature = "napi", napi_derive::napi(object))] +#[napi_derive::napi(object)] pub struct TlsConfig { pub host: String, pub reject_unauthorized: bool, } -#[cfg_attr(feature = "napi", napi_derive::napi)] +#[napi_derive::napi] pub fn read_server_config() -> ServerConfig { let cwd = env::current_dir().unwrap(); let yml = fs::File::open(cwd.join("../../.config/default.yml"))