From d790ea7d533c3c48b09a2f16f3fef549aa96be78 Mon Sep 17 00:00:00 2001 From: Yiyu Lin Date: Thu, 13 Apr 2023 09:08:01 +0800 Subject: refactor(cli,ext,ops): cleanup `regex` with `lazy-regex` (#17296) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- cli/lsp/path_to_regex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/lsp/path_to_regex.rs') diff --git a/cli/lsp/path_to_regex.rs b/cli/lsp/path_to_regex.rs index dcad6b039..01dbc0287 100644 --- a/cli/lsp/path_to_regex.rs +++ b/cli/lsp/path_to_regex.rs @@ -37,7 +37,7 @@ use std::fmt::Write as _; use std::iter::Peekable; static ESCAPE_STRING_RE: Lazy = - Lazy::new(|| Regex::new(r"([.+*?=^!:${}()\[\]|/\\])").unwrap()); + lazy_regex::lazy_regex!(r"([.+*?=^!:${}()\[\]|/\\])"); #[derive(Debug, PartialEq, Eq)] enum TokenType { -- cgit v1.2.3