Skip to content

Commit 1c7a78f

Browse files
committed
Remove last lazy_static usage
1 parent eef44b6 commit 1c7a78f

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ark/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ harp = { path = "../harp" }
2727
http = "0.2.9"
2828
home = "0.5.5"
2929
itertools = "0.10.5"
30-
lazy_static = "1.4.0"
3130
libc = "0.2"
3231
libr = { path = "../libr" }
3332
log = "0.4.17"

crates/ark/src/lsp/indexer.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use std::collections::HashMap;
99
use std::path::Path;
1010
use std::result::Result::Ok;
1111
use std::sync::Arc;
12+
use std::sync::LazyLock;
1213
use std::sync::Mutex;
1314

1415
use anyhow::anyhow;
15-
use lazy_static::lazy_static;
1616
use regex::Regex;
1717
use ropey::Rope;
1818
use stdext::unwrap;
@@ -54,10 +54,9 @@ type DocumentSymbol = String;
5454
type DocumentSymbolIndex = HashMap<DocumentSymbol, IndexEntry>;
5555
type WorkspaceIndex = Arc<Mutex<HashMap<DocumentPath, DocumentSymbolIndex>>>;
5656

57-
lazy_static! {
58-
static ref WORKSPACE_INDEX: WorkspaceIndex = Default::default();
59-
static ref RE_COMMENT_SECTION: Regex = Regex::new(r"^\s*(#+)\s*(.*?)\s*[#=-]{4,}\s*$").unwrap();
60-
}
57+
static WORKSPACE_INDEX: LazyLock<WorkspaceIndex> = LazyLock::new(|| Default::default());
58+
static RE_COMMENT_SECTION: LazyLock<Regex> =
59+
LazyLock::new(|| Regex::new(r"^\s*(#+)\s*(.*?)\s*[#=-]{4,}\s*$").unwrap());
6160

6261
#[tracing::instrument(level = "info", skip_all)]
6362
pub fn start(folders: Vec<String>) {

0 commit comments

Comments
 (0)