-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace usages of lazy_static with LazyLock (#1214)
fix #1139
- Loading branch information
1 parent
6bcc279
commit 6904ea0
Showing
18 changed files
with
334 additions
and
197 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
use lazy_static::lazy_static; | ||
use tokio::runtime::Runtime; | ||
use std::sync::LazyLock; | ||
|
||
use tokio::runtime::{Builder, Runtime}; | ||
use vortex::error::{VortexError, VortexExpect}; | ||
|
||
lazy_static! { | ||
pub static ref TOKIO_RUNTIME: Runtime = tokio::runtime::Builder::new_current_thread() | ||
pub static TOKIO_RUNTIME: LazyLock<Runtime> = LazyLock::new(|| { | ||
Builder::new_current_thread() | ||
.enable_all() | ||
.build() | ||
.map_err(VortexError::IOError) | ||
.vortex_expect("tokio runtime must not fail to start"); | ||
} | ||
.vortex_expect("tokio runtime must not fail to start") | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.