summaryrefslogtreecommitdiff
path: root/cli/lsp/registries.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-04-13 09:08:01 +0800
committerGitHub <noreply@github.com>2023-04-13 03:08:01 +0200
commitd790ea7d533c3c48b09a2f16f3fef549aa96be78 (patch)
treeb31fc35baf1f634054f52e94626f0399d187b99b /cli/lsp/registries.rs
parent19c3e4f6dc31fd78e2793d0596d6a9cc3a30580a (diff)
refactor(cli,ext,ops): cleanup `regex` with `lazy-regex` (#17296)
- bump deps: the newest `lazy-regex` need newer `oncecell` and `regex` - reduce `unwrap` - remove dep `lazy_static` - make more regex cached --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/lsp/registries.rs')
-rw-r--r--cli/lsp/registries.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/cli/lsp/registries.rs b/cli/lsp/registries.rs
index d5bdd22ca..f46aba44f 100644
--- a/cli/lsp/registries.rs
+++ b/cli/lsp/registries.rs
@@ -33,7 +33,6 @@ use deno_runtime::deno_web::BlobStore;
use deno_runtime::permissions::PermissionsContainer;
use log::error;
use once_cell::sync::Lazy;
-use regex::Regex;
use std::collections::HashMap;
use std::path::Path;
use tower_lsp::lsp_types as lsp;
@@ -66,8 +65,8 @@ const COMPONENT: &percent_encoding::AsciiSet = &percent_encoding::CONTROLS
const REGISTRY_IMPORT_COMMIT_CHARS: &[&str] = &["\"", "'", "/"];
-static REPLACEMENT_VARIABLE_RE: Lazy<Regex> =
- Lazy::new(|| Regex::new(r"\$\{\{?(\w+)\}?\}").unwrap());
+static REPLACEMENT_VARIABLE_RE: Lazy<regex::Regex> =
+ lazy_regex::lazy_regex!(r"\$\{\{?(\w+)\}?\}");
fn base_url(url: &Url) -> String {
url.origin().ascii_serialization()