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/path_to_regex.rs | |
parent | 3db18bf9e6466c74efd9052df4d372ea0b581154 (diff) |
refactor: use `once_cell` instead of `lazy_static` (#13135)
Diffstat (limited to 'cli/lsp/path_to_regex.rs')
-rw-r--r-- | cli/lsp/path_to_regex.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cli/lsp/path_to_regex.rs b/cli/lsp/path_to_regex.rs index ce935ee27..393591785 100644 --- a/cli/lsp/path_to_regex.rs +++ b/cli/lsp/path_to_regex.rs @@ -29,15 +29,14 @@ use deno_core::anyhow::anyhow; use deno_core::error::AnyError; use fancy_regex::Regex as FancyRegex; +use once_cell::sync::Lazy; use regex::Regex; use std::collections::HashMap; use std::fmt; use std::iter::Peekable; -lazy_static::lazy_static! { - static ref ESCAPE_STRING_RE: Regex = - Regex::new(r"([.+*?=^!:${}()\[\]|/\\])").unwrap(); -} +static ESCAPE_STRING_RE: Lazy<Regex> = + Lazy::new(|| Regex::new(r"([.+*?=^!:${}()\[\]|/\\])").unwrap()); #[derive(Debug, PartialEq, Eq)] enum TokenType { |