mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
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>
This commit is contained in:
parent
19c3e4f6dc
commit
d790ea7d53
23 changed files with 96 additions and 91 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue