Skip to content

Commit

Permalink
Use LazyLock to replace lazy-static
Browse files Browse the repository at this point in the history
Close: #83
  • Loading branch information
kimhanbeom authored and msk committed Aug 15, 2024
1 parent 14f13b1 commit ba2109e
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 @@ -20,7 +20,6 @@ tokio = "1"

[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 ba2109e

Please sign in to comment.