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/analysis.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/lsp/analysis.rs') diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs index 23bfeccd1..a5ebbbbb8 100644 --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -53,7 +53,7 @@ static PREFERRED_FIXES: Lazy> = }); static IMPORT_SPECIFIER_RE: Lazy = - Lazy::new(|| Regex::new(r#"\sfrom\s+["']([^"']*)["']"#).unwrap()); + lazy_regex::lazy_regex!(r#"\sfrom\s+["']([^"']*)["']"#); const SUPPORTED_EXTENSIONS: &[&str] = &[".ts", ".tsx", ".js", ".jsx", ".mjs"]; -- cgit v1.2.3