Skip to content

Commit

Permalink
Modify lazy_static to LazyLock (#134)
Browse files Browse the repository at this point in the history
Use LazyLock of rust std library
Remove lazy_static dependency
  • Loading branch information
henry0715-dev authored Aug 5, 2024
1 parent 59e4f61 commit 17fd4ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ tracing-subscriber = { version = "0.3", features = [

[dev-dependencies]
futures = "0.3"
lazy_static = "1"
quinn = { version = "0.11", features = ["ring"] }
rcgen = "0.13"
rustls = { version = "0.23", default-features = false, features = [
Expand Down
7 changes: 3 additions & 4 deletions src/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Shared test code

use lazy_static::lazy_static;
use std::sync::LazyLock;

use quinn::{Connection, RecvStream, SendStream};
use tokio::sync::Mutex;

Expand All @@ -15,9 +16,7 @@ pub(crate) struct Endpoint {
pub(crate) recv: RecvStream,
}

lazy_static! {
pub(crate) static ref TOKEN: Mutex<u32> = Mutex::new(0);
}
pub(crate) static TOKEN: LazyLock<Mutex<u32>> = LazyLock::new(|| Mutex::new(0));

/// Creates a bidirectional channel, returning server's send and receive and
/// client's send and receive streams.
Expand Down

0 comments on commit 17fd4ae

Please sign in to comment.