From 4ce4828a7835fbe8c2e93cdaa5d4cfb191b147b2 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Tue, 15 Apr 2025 16:06:03 +0100 Subject: [PATCH] lrwn: Remove lazy_static dependency. --- Cargo.lock | 1 - lrwn/Cargo.toml | 3 --- lrwn/src/lib.rs | 40 ++++++++++++++++++---------------------- 3 files changed, 18 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 830e57b9..4a9c89bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2785,7 +2785,6 @@ dependencies = [ "cmac", "diesel", "hex", - "lazy_static", "serde", "thiserror 2.0.12", ] diff --git a/lrwn/Cargo.toml b/lrwn/Cargo.toml index 43e98979..6e8572c2 100644 --- a/lrwn/Cargo.toml +++ b/lrwn/Cargo.toml @@ -22,9 +22,6 @@ thiserror = "2.0" anyhow = "1.0" - # Misc - lazy_static = "1.5" - [features] default = [] diesel = ["dep:diesel", "serde"] diff --git a/lrwn/src/lib.rs b/lrwn/src/lib.rs index e087d819..2a935dbb 100644 --- a/lrwn/src/lib.rs +++ b/lrwn/src/lib.rs @@ -3,8 +3,6 @@ extern crate diesel; #[macro_use] extern crate anyhow; -#[macro_use] -extern crate lazy_static; pub use self::aes128::*; pub use self::cflist::*; @@ -43,26 +41,24 @@ mod relay; pub const LA_FPORT_RELAY: u8 = 226; -lazy_static! { - static ref EIRP_INDEX: Vec = vec![ - 8.0, // 0 - 10.0, // 1 - 12.0, // 2 - 13.0, // 3 - 14.0, // 4 - 16.0, // 5 - 18.0, // 6 - 20.0, // 7 - 21.0, // 8 - 24.0, // 9 - 26.0, // 10 - 27.0, // 11 - 29.0, // 12 - 30.0, // 13 - 33.0, // 14 - 36.0, // 15 - ]; -} +const EIRP_INDEX: [f32; 16] = [ + 8.0, // 0 + 10.0, // 1 + 12.0, // 2 + 13.0, // 3 + 14.0, // 4 + 16.0, // 5 + 18.0, // 6 + 20.0, // 7 + 21.0, // 8 + 24.0, // 9 + 26.0, // 10 + 27.0, // 11 + 29.0, // 12 + 30.0, // 13 + 33.0, // 14 + 36.0, // 15 +]; pub fn get_tx_param_setup_eirp_index(eirp: f32) -> u8 { let mut out: u8 = 0;