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/urls.rs | |
parent | 3db18bf9e6466c74efd9052df4d372ea0b581154 (diff) |
refactor: use `once_cell` instead of `lazy_static` (#13135)
Diffstat (limited to 'cli/lsp/urls.rs')
-rw-r--r-- | cli/lsp/urls.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/lsp/urls.rs b/cli/lsp/urls.rs index 19f53f297..94830d34a 100644 --- a/cli/lsp/urls.rs +++ b/cli/lsp/urls.rs @@ -9,13 +9,13 @@ use deno_core::error::AnyError; use deno_core::url::Position; use deno_core::url::Url; use deno_core::ModuleSpecifier; +use once_cell::sync::Lazy; use std::collections::HashMap; -lazy_static::lazy_static! { - /// Used in situations where a default URL needs to be used where otherwise a - /// panic is undesired. - pub(crate) static ref INVALID_SPECIFIER: ModuleSpecifier = ModuleSpecifier::parse("deno://invalid").unwrap(); -} +/// Used in situations where a default URL needs to be used where otherwise a +/// panic is undesired. +pub(crate) static INVALID_SPECIFIER: Lazy<ModuleSpecifier> = + Lazy::new(|| ModuleSpecifier::parse("deno://invalid").unwrap()); /// Matches the `encodeURIComponent()` encoding from JavaScript, which matches /// the component percent encoding set. |