mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
refactor: use once_cell
instead of lazy_static
(#13135)
This commit is contained in:
parent
3db18bf9e6
commit
6de53b631f
27 changed files with 434 additions and 313 deletions
|
@ -31,6 +31,7 @@ use deno_runtime::deno_web::BlobStore;
|
|||
use deno_runtime::permissions::Permissions;
|
||||
use log::error;
|
||||
use lspower::lsp;
|
||||
use once_cell::sync::Lazy;
|
||||
use regex::Regex;
|
||||
use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
|
@ -61,10 +62,8 @@ const COMPONENT: &percent_encoding::AsciiSet = &percent_encoding::CONTROLS
|
|||
.add(b'+')
|
||||
.add(b',');
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref REPLACEMENT_VARIABLE_RE: Regex =
|
||||
Regex::new(r"\$\{\{?(\w+)\}?\}").unwrap();
|
||||
}
|
||||
static REPLACEMENT_VARIABLE_RE: Lazy<Regex> =
|
||||
Lazy::new(|| Regex::new(r"\$\{\{?(\w+)\}?\}").unwrap());
|
||||
|
||||
fn base_url(url: &Url) -> String {
|
||||
url.origin().ascii_serialization()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue