Skip to content

Commit

Permalink
Remove last lazy_static usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Sep 26, 2024
1 parent eef44b6 commit 1c7a78f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/ark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ harp = { path = "../harp" }
http = "0.2.9"
home = "0.5.5"
itertools = "0.10.5"
lazy_static = "1.4.0"
libc = "0.2"
libr = { path = "../libr" }
log = "0.4.17"
Expand Down
9 changes: 4 additions & 5 deletions crates/ark/src/lsp/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use std::collections::HashMap;
use std::path::Path;
use std::result::Result::Ok;
use std::sync::Arc;
use std::sync::LazyLock;
use std::sync::Mutex;

use anyhow::anyhow;
use lazy_static::lazy_static;
use regex::Regex;
use ropey::Rope;
use stdext::unwrap;
Expand Down Expand Up @@ -54,10 +54,9 @@ type DocumentSymbol = String;
type DocumentSymbolIndex = HashMap<DocumentSymbol, IndexEntry>;
type WorkspaceIndex = Arc<Mutex<HashMap<DocumentPath, DocumentSymbolIndex>>>;

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

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

0 comments on commit 1c7a78f

Please sign in to comment.