diff options
author | 2024-09-03 14:44:30 +0100 | |
---|---|---|
committer | 2024-09-05 10:59:00 -0700 | |
commit | c747e371e19302ef8ce40dcfca5464c0c91d768d (patch) | |
tree | 8cec649e9293e75df0297799be03eff68d7754ab /floss | |
parent | 7862ca675e465ef5ec36335d26bc3734579521c1 (diff) |
Use std::sync::LazyLock rather than lazy_static.
Bug: 364211748
Test: atest libbt_common_inline_tests
Change-Id: I034e6143df298e80565c720bdbf440d4d9939c3f
Diffstat (limited to 'floss')
-rw-r--r-- | floss/hcidoc/Cargo.toml | 1 | ||||
-rw-r--r-- | floss/hcidoc/src/groups/controllers.rs | 23 |
2 files changed, 12 insertions, 12 deletions
diff --git a/floss/hcidoc/Cargo.toml b/floss/hcidoc/Cargo.toml index 920e4af12d..761d6647f3 100644 --- a/floss/hcidoc/Cargo.toml +++ b/floss/hcidoc/Cargo.toml @@ -9,4 +9,3 @@ clap = "4.0" chrono = "0.4" num-derive = "0.3" num-traits = "0.2" -lazy_static = "1.0" diff --git a/floss/hcidoc/src/groups/controllers.rs b/floss/hcidoc/src/groups/controllers.rs index 3790a1fb8b..5ba037a01e 100644 --- a/floss/hcidoc/src/groups/controllers.rs +++ b/floss/hcidoc/src/groups/controllers.rs @@ -1,9 +1,9 @@ ///! Rule group for tracking controller related issues. use chrono::NaiveDateTime; -use lazy_static::lazy_static; use std::collections::HashSet; use std::convert::Into; use std::io::Write; +use std::sync::LazyLock; use crate::engine::{Rule, RuleGroup, Signal}; use crate::parser::{NewIndex, Packet, PacketChild}; @@ -23,16 +23,17 @@ impl Into<&'static str> for ControllerSignal { } } -lazy_static! { - static ref KNOWN_CONTROLLER_NAMES: [String; 6] = [ - String::from("Bluemoon Universal Bluetooth Host Controller"), // AC7625 - String::from("MTK MT7961 #1"), // MT7921LE/MT7921LS - String::from("MTK MT7922 #1"), // MT7922 - String::from("RTK_BT_5.0"), // RTL8822CE - String::from("RT_BT"), // RTL8852AE - String::from(""), // AC9260/AC9560/AX200/AX201/AX203/AX211/MVL8897/QCA6174A3/QCA6174A5/QC_WCN6856 - ]; -} +static KNOWN_CONTROLLER_NAMES: LazyLock<[String; 6]> = LazyLock::new(|| { + [ + String::from("Bluemoon Universal Bluetooth Host Controller"), // AC7625 + String::from("MTK MT7961 #1"), // MT7921LE/MT7921LS + String::from("MTK MT7922 #1"), // MT7922 + String::from("RTK_BT_5.0"), // RTL8822CE + String::from("RT_BT"), // RTL8852AE + String::from(""), // AC9260/AC9560/AX200/AX201/AX203/AX211/MVL8897/QCA6174A3/QCA6174A5/QC_WCN6856 + ] +}); + const KNOWN_CONTROLLER_MANUFACTURERS: [u16; 5] = [ 2, // Intel. 29, // Qualcomm |