chore: Replace lazy_static Mutex with const. (#2693)

Mutex::new() is const-stable as of Rust 1.63.

Release Notes:
- N/A
This commit is contained in:
Piotr Osiewicz 2023-07-07 15:07:12 +02:00 committed by GitHub
parent 79ece8a86e
commit abf3b4a54e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 8 additions and 27 deletions

View file

@ -17,7 +17,6 @@ test-support = [
"async-trait",
"collections/test-support",
"gpui/test-support",
"lazy_static",
"live_kit_server",
"nanoid",
]
@ -38,7 +37,6 @@ parking_lot.workspace = true
postage.workspace = true
async-trait = { workspace = true, optional = true }
lazy_static = { workspace = true, optional = true }
nanoid = { version ="0.4", optional = true}
[dev-dependencies]
@ -60,7 +58,6 @@ foreign-types = "0.3"
futures.workspace = true
hmac = "0.12"
jwt = "0.16"
lazy_static.workspace = true
objc = "0.2"
parking_lot.workspace = true
serde.workspace = true

View file

@ -1,18 +1,15 @@
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use collections::HashMap;
use collections::{BTreeMap, HashMap};
use futures::Stream;
use gpui::executor::Background;
use lazy_static::lazy_static;
use live_kit_server::token;
use media::core_video::CVImageBuffer;
use parking_lot::Mutex;
use postage::watch;
use std::{future::Future, mem, sync::Arc};
lazy_static! {
static ref SERVERS: Mutex<HashMap<String, Arc<TestServer>>> = Default::default();
}
static SERVERS: Mutex<BTreeMap<String, Arc<TestServer>>> = Mutex::new(BTreeMap::new());
pub struct TestServer {
pub url: String,