diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2021-12-19 02:44:42 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-18 16:14:42 -0500 |
commit | 6de53b631fcdb96d72639b6d2db3592d5fa8498d (patch) | |
tree | 9a93d868f5f434a4898f212cb6bd53e65ca49ce0 /cli/lsp/code_lens.rs | |
parent | 3db18bf9e6466c74efd9052df4d372ea0b581154 (diff) |
refactor: use `once_cell` instead of `lazy_static` (#13135)
Diffstat (limited to 'cli/lsp/code_lens.rs')
-rw-r--r-- | cli/lsp/code_lens.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cli/lsp/code_lens.rs b/cli/lsp/code_lens.rs index 852f286ab..635f34916 100644 --- a/cli/lsp/code_lens.rs +++ b/cli/lsp/code_lens.rs @@ -20,16 +20,18 @@ use deno_core::serde_json; use deno_core::serde_json::json; use deno_core::ModuleSpecifier; use lspower::lsp; +use once_cell::sync::Lazy; use regex::Regex; use std::cell::RefCell; use std::collections::HashSet; use std::rc::Rc; use std::sync::Arc; -lazy_static::lazy_static! { - static ref ABSTRACT_MODIFIER: Regex = Regex::new(r"\babstract\b").unwrap(); - static ref EXPORT_MODIFIER: Regex = Regex::new(r"\bexport\b").unwrap(); -} +static ABSTRACT_MODIFIER: Lazy<Regex> = + Lazy::new(|| Regex::new(r"\babstract\b").unwrap()); + +static EXPORT_MODIFIER: Lazy<Regex> = + Lazy::new(|| Regex::new(r"\bexport\b").unwrap()); #[derive(Debug, Deserialize, Serialize)] pub enum CodeLensSource { |