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
9 changed files with 8 additions and 27 deletions
+1 -5
View File
@@ -11,8 +11,6 @@ use gpui::keymap_matcher::Keystroke;
use language::Point;
#[cfg(feature = "neovim")]
use lazy_static::lazy_static;
#[cfg(feature = "neovim")]
use nvim_rs::{
create::tokio::new_child_cmd, error::LoopError, Handler, Neovim, UiAttachOptions, Value,
@@ -32,9 +30,7 @@ use collections::VecDeque;
// Neovim doesn't like to be started simultaneously from multiple threads. We use this lock
// to ensure we are only constructing one neovim connection at a time.
#[cfg(feature = "neovim")]
lazy_static! {
static ref NEOVIM_LOCK: ReentrantMutex<()> = ReentrantMutex::new(());
}
static NEOVIM_LOCK: ReentrantMutex<()> = ReentrantMutex::new(());
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub enum NeovimData {