This is an automated email from the ASF dual-hosted git repository.
mmodzelewski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/master by this push:
new 8a19837b7 chore: remove `once_cell` in favor of the standard library
(#3524)
8a19837b7 is described below
commit 8a19837b7e3a778466b39d4f760c99a51e0e242a
Author: llogiq <[email protected]>
AuthorDate: Thu Jun 25 09:39:22 2026 +0200
chore: remove `once_cell` in favor of the standard library (#3524)
---
Cargo.lock | 14 --------------
Cargo.toml | 1 -
core/connectors/runtime/Cargo.toml | 1 -
core/connectors/runtime/src/source.rs | 6 +++---
core/connectors/sdk/Cargo.toml | 1 -
core/connectors/sdk/src/lib.rs | 7 +++----
core/connectors/sdk/src/sink.rs | 5 +++--
core/connectors/sdk/src/source.rs | 5 +++--
core/connectors/sinks/README.md | 1 -
core/connectors/sinks/delta_sink/Cargo.toml | 3 +--
core/connectors/sinks/elasticsearch_sink/Cargo.toml | 3 +--
core/connectors/sinks/iceberg_sink/Cargo.toml | 3 +--
core/connectors/sinks/postgres_sink/Cargo.toml | 3 +--
core/connectors/sinks/quickwit_sink/Cargo.toml | 3 +--
core/connectors/sinks/stdout_sink/Cargo.toml | 3 +--
core/connectors/sources/README.md | 1 -
core/connectors/sources/elasticsearch_source/Cargo.toml | 3 +--
core/connectors/sources/influxdb_source/Cargo.toml | 15 +++++++--------
core/connectors/sources/influxdb_source/dependencies.md | 1 -
core/connectors/sources/postgres_source/Cargo.toml | 3 +--
core/connectors/sources/random_source/Cargo.toml | 3 +--
core/integration/Cargo.toml | 1 -
core/integration/src/harness/context.rs | 8 ++++----
.../tests/server/scenarios/log_rotation_scenario.rs | 4 ++--
core/server_common/Cargo.toml | 1 -
core/server_common/src/memory_pool.rs | 5 ++---
26 files changed, 36 insertions(+), 68 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 12382acfc..5c9905cab 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6660,7 +6660,6 @@ dependencies = [
"iggy_common",
"iggy_connector_sdk",
"mimalloc",
- "once_cell",
"opentelemetry",
"opentelemetry-appender-tracing",
"opentelemetry-otlp",
@@ -6780,7 +6779,6 @@ dependencies = [
"dashmap",
"deltalake",
"iggy_connector_sdk",
- "once_cell",
"secrecy",
"serde",
"serde_json",
@@ -6819,7 +6817,6 @@ dependencies = [
"elasticsearch",
"iggy_common",
"iggy_connector_sdk",
- "once_cell",
"secrecy",
"serde",
"serde_json",
@@ -6838,7 +6835,6 @@ dependencies = [
"humantime",
"iggy_common",
"iggy_connector_sdk",
- "once_cell",
"secrecy",
"serde",
"serde_json",
@@ -6880,7 +6876,6 @@ dependencies = [
"iceberg-catalog-rest",
"iceberg-storage-opendal",
"iggy_connector_sdk",
- "once_cell",
"parquet 57.3.1",
"serde",
"simd-json",
@@ -6923,7 +6918,6 @@ dependencies = [
"dashmap",
"iggy_common",
"iggy_connector_sdk",
- "once_cell",
"regex",
"reqwest 0.13.4",
"reqwest-middleware",
@@ -6963,7 +6957,6 @@ dependencies = [
"humantime",
"iggy_common",
"iggy_connector_sdk",
- "once_cell",
"secrecy",
"serde",
"serde_json",
@@ -6985,7 +6978,6 @@ dependencies = [
"humantime",
"iggy_common",
"iggy_connector_sdk",
- "once_cell",
"secrecy",
"serde",
"serde_json",
@@ -7003,7 +6995,6 @@ dependencies = [
"async-trait",
"dashmap",
"iggy_connector_sdk",
- "once_cell",
"reqwest 0.13.4",
"serde",
"serde_yaml_ng",
@@ -7019,7 +7010,6 @@ dependencies = [
"dashmap",
"humantime",
"iggy_connector_sdk",
- "once_cell",
"rand 0.10.1",
"rmp-serde",
"serde",
@@ -7043,7 +7033,6 @@ dependencies = [
"humantime",
"iggy",
"iggy_common",
- "once_cell",
"postcard",
"prost",
"prost-types",
@@ -7073,7 +7062,6 @@ dependencies = [
"async-trait",
"dashmap",
"iggy_connector_sdk",
- "once_cell",
"serde",
"tokio",
"tracing",
@@ -7290,7 +7278,6 @@ dependencies = [
"lazy_static",
"libc",
"mongodb",
- "once_cell",
"predicates",
"rand 0.10.1",
"rcgen",
@@ -11672,7 +11659,6 @@ dependencies = [
"lending-iterator",
"moka",
"nix",
- "once_cell",
"rcgen",
"rustls",
"serial_test",
diff --git a/Cargo.toml b/Cargo.toml
index a5a2b5203..4d196d963 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -214,7 +214,6 @@ nix = { version = "0.31.3", features = ["feature", "fs",
"resource", "sched"] }
nonzero_lit = "0.1.2"
notify = "8.2.0"
octocrab = "0.53.1"
-once_cell = "1.21.4"
opentelemetry = { version = "0.32.0", features = ["trace", "logs"] }
opentelemetry-appender-tracing = { version = "0.32.0", features = ["log"] }
opentelemetry-otlp = { version = "0.32.0", features = [
diff --git a/core/connectors/runtime/Cargo.toml
b/core/connectors/runtime/Cargo.toml
index 0f7882267..e5b805e32 100644
--- a/core/connectors/runtime/Cargo.toml
+++ b/core/connectors/runtime/Cargo.toml
@@ -49,7 +49,6 @@ iggy = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true, features = ["api"] }
mimalloc = { workspace = true }
-once_cell = { workspace = true }
opentelemetry = { workspace = true }
opentelemetry-appender-tracing = { workspace = true }
opentelemetry-otlp = { workspace = true }
diff --git a/core/connectors/runtime/src/source.rs
b/core/connectors/runtime/src/source.rs
index a3e0e429f..e259e212c 100644
--- a/core/connectors/runtime/src/source.rs
+++ b/core/connectors/runtime/src/source.rs
@@ -27,11 +27,10 @@ use iggy_connector_sdk::{
ConnectorState, DecodedMessage, ProducedMessages, Schema, StreamEncoder,
TopicMetadata,
source::HandleCallback, transforms::Transform,
};
-use once_cell::sync::Lazy;
use std::{
collections::{BTreeMap, HashMap},
str::FromStr,
- sync::{Arc, atomic::Ordering},
+ sync::{Arc, LazyLock, atomic::Ordering},
time::Instant,
};
use tracing::{debug, error, info, trace, warn};
@@ -58,7 +57,8 @@ pub(crate) struct SourceSenderEntry {
pub(crate) error_counter: Counter,
}
-pub(crate) static SOURCE_SENDERS: Lazy<DashMap<u32, SourceSenderEntry>> =
Lazy::new(DashMap::new);
+pub(crate) static SOURCE_SENDERS: LazyLock<DashMap<u32, SourceSenderEntry>> =
+ LazyLock::new(DashMap::new);
pub(crate) fn cleanup_sender(plugin_id: u32) {
SOURCE_SENDERS.remove(&plugin_id);
diff --git a/core/connectors/sdk/Cargo.toml b/core/connectors/sdk/Cargo.toml
index 94cfbfc8e..fcd2b6f2a 100644
--- a/core/connectors/sdk/Cargo.toml
+++ b/core/connectors/sdk/Cargo.toml
@@ -47,7 +47,6 @@ http = { workspace = true }
humantime = { workspace = true }
iggy = { workspace = true }
iggy_common = { workspace = true }
-once_cell = { workspace = true }
postcard = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
diff --git a/core/connectors/sdk/src/lib.rs b/core/connectors/sdk/src/lib.rs
index 2e16d2a5e..c8ed2ff94 100644
--- a/core/connectors/sdk/src/lib.rs
+++ b/core/connectors/sdk/src/lib.rs
@@ -26,10 +26,10 @@ use encoders::{
proto::ProtoStreamEncoder, raw::RawStreamEncoder, text::TextStreamEncoder,
};
use iggy::prelude::{HeaderKey, HeaderValue};
-use once_cell::sync::OnceCell;
use prost::Message;
use serde::{Deserialize, Serialize};
-use std::{collections::BTreeMap, sync::Arc};
+use std::collections::BTreeMap;
+use std::sync::{Arc, OnceLock};
use strum_macros::{Display, IntoStaticStr};
use thiserror::Error;
use tokio::runtime::Runtime;
@@ -52,10 +52,9 @@ pub use transforms::Transform;
#[doc(hidden)]
pub mod connector_macro_support {
pub use dashmap::DashMap;
- pub use once_cell::sync::Lazy;
}
-static RUNTIME: OnceCell<Runtime> = OnceCell::new();
+static RUNTIME: OnceLock<Runtime> = OnceLock::new();
pub fn get_runtime() -> &'static Runtime {
RUNTIME.get_or_init(|| Runtime::new().expect("Failed to create Tokio
runtime"))
diff --git a/core/connectors/sdk/src/sink.rs b/core/connectors/sdk/src/sink.rs
index 6ae40c18e..332f73c4e 100644
--- a/core/connectors/sdk/src/sink.rs
+++ b/core/connectors/sdk/src/sink.rs
@@ -243,11 +243,12 @@ macro_rules! sink_connector {
assert_trait::<$type>();
};
- use $crate::connector_macro_support::{DashMap, Lazy};
+ use $crate::connector_macro_support::DashMap;
use $crate::LogCallback;
use $crate::sink::SinkContainer;
+ use std::sync::LazyLock;
- static INSTANCES: Lazy<DashMap<u32, SinkContainer<$type>>> =
Lazy::new(DashMap::new);
+ static INSTANCES: LazyLock<DashMap<u32, SinkContainer<$type>>> =
LazyLock::new(DashMap::new);
#[cfg(not(test))]
#[unsafe(no_mangle)]
diff --git a/core/connectors/sdk/src/source.rs
b/core/connectors/sdk/src/source.rs
index c6902d41c..713e00c6a 100644
--- a/core/connectors/sdk/src/source.rs
+++ b/core/connectors/sdk/src/source.rs
@@ -213,12 +213,13 @@ macro_rules! source_connector {
};
use dashmap::DashMap;
- use once_cell::sync::Lazy;
+ use std::sync::LazyLock;
use $crate::LogCallback;
use $crate::source::SendCallback;
use $crate::source::SourceContainer;
- static INSTANCES: Lazy<DashMap<u32, SourceContainer<$type>>> =
Lazy::new(DashMap::new);
+ static INSTANCES: LazyLock<DashMap<u32, SourceContainer<$type>>> =
+ LazyLock::new(DashMap::new);
#[cfg(not(test))]
#[unsafe(no_mangle)]
diff --git a/core/connectors/sinks/README.md b/core/connectors/sinks/README.md
index 9aaaa2ffa..367a22028 100644
--- a/core/connectors/sinks/README.md
+++ b/core/connectors/sinks/README.md
@@ -170,7 +170,6 @@ sink_connector!(StdoutSink);
At a bare minimum, we need to add the following dependencies to the
`Cargo.toml` file to compile the plugin at all:
- dashmap
-- once_cell
- tracing
Now, let's implement the `Sink` trait for our `StdoutSink` struct.
diff --git a/core/connectors/sinks/delta_sink/Cargo.toml
b/core/connectors/sinks/delta_sink/Cargo.toml
index baa0104bb..72a11cf0f 100644
--- a/core/connectors/sinks/delta_sink/Cargo.toml
+++ b/core/connectors/sinks/delta_sink/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell"]
+ignored = ["dashmap"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -41,7 +41,6 @@ chrono = { workspace = true }
dashmap = { workspace = true }
deltalake = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
diff --git a/core/connectors/sinks/elasticsearch_sink/Cargo.toml
b/core/connectors/sinks/elasticsearch_sink/Cargo.toml
index 4d70be534..93e848316 100644
--- a/core/connectors/sinks/elasticsearch_sink/Cargo.toml
+++ b/core/connectors/sinks/elasticsearch_sink/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell", "futures", "simd-json"]
+ignored = ["dashmap", "futures", "simd-json"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -42,7 +42,6 @@ dashmap = { workspace = true }
elasticsearch = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
diff --git a/core/connectors/sinks/iceberg_sink/Cargo.toml
b/core/connectors/sinks/iceberg_sink/Cargo.toml
index fe868e482..1624ae0b6 100644
--- a/core/connectors/sinks/iceberg_sink/Cargo.toml
+++ b/core/connectors/sinks/iceberg_sink/Cargo.toml
@@ -29,7 +29,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell"]
+ignored = ["dashmap"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -42,7 +42,6 @@ iceberg = { workspace = true }
iceberg-catalog-rest = { workspace = true }
iceberg-storage-opendal = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
parquet = { workspace = true }
serde = { workspace = true }
simd-json = { workspace = true }
diff --git a/core/connectors/sinks/postgres_sink/Cargo.toml
b/core/connectors/sinks/postgres_sink/Cargo.toml
index d30c263c2..7c2bd8e3d 100644
--- a/core/connectors/sinks/postgres_sink/Cargo.toml
+++ b/core/connectors/sinks/postgres_sink/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell", "futures", "simd-json", "prost"]
+ignored = ["dashmap", "futures", "simd-json", "prost"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -42,7 +42,6 @@ futures = { workspace = true }
humantime = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
diff --git a/core/connectors/sinks/quickwit_sink/Cargo.toml
b/core/connectors/sinks/quickwit_sink/Cargo.toml
index 8652dc287..b89010baf 100644
--- a/core/connectors/sinks/quickwit_sink/Cargo.toml
+++ b/core/connectors/sinks/quickwit_sink/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell"]
+ignored = ["dashmap"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -39,7 +39,6 @@ crate-type = ["cdylib", "lib"]
async-trait = { workspace = true }
dashmap = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
reqwest = { workspace = true }
serde = { workspace = true }
serde_yaml_ng = { workspace = true }
diff --git a/core/connectors/sinks/stdout_sink/Cargo.toml
b/core/connectors/sinks/stdout_sink/Cargo.toml
index a473934c6..b7a4f4cf7 100644
--- a/core/connectors/sinks/stdout_sink/Cargo.toml
+++ b/core/connectors/sinks/stdout_sink/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell"]
+ignored = ["dashmap"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -39,7 +39,6 @@ crate-type = ["cdylib", "lib"]
async-trait = { workspace = true }
dashmap = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
serde = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
diff --git a/core/connectors/sources/README.md
b/core/connectors/sources/README.md
index 68d324338..34989aef0 100644
--- a/core/connectors/sources/README.md
+++ b/core/connectors/sources/README.md
@@ -178,7 +178,6 @@ source_connector!(TestSource);
At a bare minimum, we need to add the following dependencies to the
`Cargo.toml` file to compile the plugin at all:
- dashmap
-- once_cell
- tracing
Before we make use of the `Source` trait, let's define the internal payload of
the message that will be produced (e.g. as if it was pulled from some external
database or so).
diff --git a/core/connectors/sources/elasticsearch_source/Cargo.toml
b/core/connectors/sources/elasticsearch_source/Cargo.toml
index e9c49d5b4..8b4638029 100644
--- a/core/connectors/sources/elasticsearch_source/Cargo.toml
+++ b/core/connectors/sources/elasticsearch_source/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell", "futures", "simd-json"]
+ignored = ["dashmap", "futures", "simd-json"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -42,7 +42,6 @@ elasticsearch = { workspace = true }
humantime = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
diff --git a/core/connectors/sources/influxdb_source/Cargo.toml
b/core/connectors/sources/influxdb_source/Cargo.toml
index 549f153ab..817d9b803 100644
--- a/core/connectors/sources/influxdb_source/Cargo.toml
+++ b/core/connectors/sources/influxdb_source/Cargo.toml
@@ -29,14 +29,14 @@ repository = "https://github.com/apache/iggy"
readme = "../../README.md"
publish = false
-# dashmap and once_cell are not imported directly in this crate's source, but
-# the source_connector! macro (in iggy_connector_sdk::source) expands bare
-# `use dashmap::DashMap` and `use once_cell::sync::Lazy` into this crate's
-# namespace, so they must be listed here. Remove them only after the SDK macro
-# is updated to use `$crate::connector_macro_support::{DashMap, Lazy}` (the
-# same fix already applied to sink_connector!).
+# dashmap is not imported directly in this crate's source, but the
+# source_connector! macro (in iggy_connector_sdk::source) expands bare
+# `use dashmap::DashMap` into this crate's namespace, so they must be listed
+# here. Remove them only after the SDK macro is updated to use
+# `$crate::connector_macro_support::{DashMap, Lazy}` (the same fix already
+# applied to sink_connector!).
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell"]
+ignored = ["dashmap"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -50,7 +50,6 @@ csv = { workspace = true }
dashmap = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
reqwest-middleware = { workspace = true }
diff --git a/core/connectors/sources/influxdb_source/dependencies.md
b/core/connectors/sources/influxdb_source/dependencies.md
index c7918dc35..05d5214c4 100644
--- a/core/connectors/sources/influxdb_source/dependencies.md
+++ b/core/connectors/sources/influxdb_source/dependencies.md
@@ -44,7 +44,6 @@ to `cargo tree -p iggy_connector_influxdb_source` for the
full graph.
| `dashmap` | `^6.1.0` | MIT | Concurrent hash map; injected into this crate's
namespace by the `source_connector!` macro expansion in the SDK. Not used
directly in source files. |
| `iggy_common` | `^0.10.1-edge.1` | Apache-2.0 | Shared Iggy types:
`DateTime`, `Utc`, and `serde_secret` used for safe token serialisation in
config structs. |
| `iggy_connector_sdk` | `^0.3.1-edge.1` | Apache-2.0 | Core connector
abstractions: `Source` trait, `ProducedMessage`, `ProducedMessages`,
`ConnectorState`, `Schema`, `Error`, retry/circuit-breaker utilities, and the
`source_connector!` registration macro. |
-| `once_cell` | `^1.21.4` | MIT / Apache-2.0 | `Lazy` global; injected by the
`source_connector!` macro expansion in the SDK. Not used directly in source
files. |
| `regex` | `^1.12.3` | MIT / Apache-2.0 | Compiles the RFC 3339
cursor-validation regex once via `OnceLock` in `common.rs::cursor_re()`. |
| `reqwest` | `^0.13.3` | MIT / Apache-2.0 | Async HTTP client used to issue
Flux (V2) and SQL (V3) query requests to InfluxDB. |
| `reqwest-middleware` | `^0.5.1` | MIT | Middleware wrapper around
`reqwest::Client` that attaches the retry and tracing layers built by
`iggy_connector_sdk::retry::build_retry_client`. |
diff --git a/core/connectors/sources/postgres_source/Cargo.toml
b/core/connectors/sources/postgres_source/Cargo.toml
index 62af821ad..8860c177f 100644
--- a/core/connectors/sources/postgres_source/Cargo.toml
+++ b/core/connectors/sources/postgres_source/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell", "futures", "simd-json"]
+ignored = ["dashmap", "futures", "simd-json"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -48,7 +48,6 @@ futures = { workspace = true }
humantime = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
diff --git a/core/connectors/sources/random_source/Cargo.toml
b/core/connectors/sources/random_source/Cargo.toml
index 9884e34ac..ffd6a4d93 100644
--- a/core/connectors/sources/random_source/Cargo.toml
+++ b/core/connectors/sources/random_source/Cargo.toml
@@ -30,7 +30,7 @@ readme = "../../README.md"
publish = false
[package.metadata.cargo-machete]
-ignored = ["dashmap", "once_cell"]
+ignored = ["dashmap"]
[lib]
crate-type = ["cdylib", "lib"]
@@ -40,7 +40,6 @@ async-trait = { workspace = true }
dashmap = { workspace = true }
humantime = { workspace = true }
iggy_connector_sdk = { workspace = true }
-once_cell = { workspace = true }
rand = { workspace = true }
rmp-serde = { workspace = true }
serde = { workspace = true }
diff --git a/core/integration/Cargo.toml b/core/integration/Cargo.toml
index 81ba70ed9..f0cddf0c0 100644
--- a/core/integration/Cargo.toml
+++ b/core/integration/Cargo.toml
@@ -62,7 +62,6 @@ keyring-core = { workspace = true }
lazy_static = { workspace = true }
libc = { workspace = true }
mongodb = { workspace = true }
-once_cell = { workspace = true }
predicates = { workspace = true }
rand = { workspace = true }
rcgen = { workspace = true }
diff --git a/core/integration/src/harness/context.rs
b/core/integration/src/harness/context.rs
index 1d50c9bf8..57e409039 100644
--- a/core/integration/src/harness/context.rs
+++ b/core/integration/src/harness/context.rs
@@ -16,10 +16,10 @@
// under the License.
use crate::harness::error::TestBinaryError;
-use once_cell::sync::Lazy;
use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
+use std::sync::LazyLock;
use std::sync::RwLock;
use std::thread;
use uuid::Uuid;
@@ -27,8 +27,8 @@ use uuid::Uuid;
const TEST_CLEANUP_DISABLED_ENV_VAR: &str = "IGGY_TEST_CLEANUP_DISABLED";
/// Global registry mapping test names to their log directories.
-static TEST_DIRECTORIES: Lazy<RwLock<HashMap<String, PathBuf>>> =
- Lazy::new(|| RwLock::new(HashMap::new()));
+static TEST_DIRECTORIES: LazyLock<RwLock<HashMap<String, PathBuf>>> =
+ LazyLock::new(|| RwLock::new(HashMap::new()));
/// Get the log directory for a test by name.
pub fn get_test_directory(test_name: &str) -> Option<PathBuf> {
@@ -50,7 +50,7 @@ fn is_cleanup_disabled_by_env() -> bool {
.unwrap_or(false)
}
-static TEST_LOGS_DIR: Lazy<PathBuf> = Lazy::new(|| {
+static TEST_LOGS_DIR: LazyLock<PathBuf> = LazyLock::new(|| {
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.parent()
.and_then(|p| p.parent())
diff --git a/core/integration/tests/server/scenarios/log_rotation_scenario.rs
b/core/integration/tests/server/scenarios/log_rotation_scenario.rs
index f425248bf..dbb180701 100644
--- a/core/integration/tests/server/scenarios/log_rotation_scenario.rs
+++ b/core/integration/tests/server/scenarios/log_rotation_scenario.rs
@@ -21,10 +21,10 @@ use iggy_common::{
CompressionAlgorithm, Identifier, IggyByteSize, IggyDuration, IggyExpiry,
MaxTopicSize,
};
use integration::harness::{TestHarness, TestServerConfig};
-use once_cell::sync::Lazy;
use serial_test::parallel;
use std::collections::HashMap;
use std::path::Path;
+use std::sync::LazyLock;
use std::time::Duration;
use test_case::test_matrix;
use tokio::fs;
@@ -37,7 +37,7 @@ const OPERATION_LOOP_COUNT: usize = 300;
const FROM_BYTES_TO_KB: u64 = 1000;
const IGGY_LOG_BASE_NAME: &str = "iggy-server.log";
-static PRINT_LOCK: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
+static PRINT_LOCK: LazyLock<Mutex<()>> = LazyLock::new(|| Mutex::new(()));
#[derive(Debug)]
pub struct LogRotationTestConfig {
diff --git a/core/server_common/Cargo.toml b/core/server_common/Cargo.toml
index 6bbb35c29..9b658b9e0 100644
--- a/core/server_common/Cargo.toml
+++ b/core/server_common/Cargo.toml
@@ -36,7 +36,6 @@ iggy_binary_protocol = { workspace = true }
iggy_common = { workspace = true }
lending-iterator = { workspace = true }
moka = { workspace = true }
-once_cell = { workspace = true }
rcgen = { workspace = true }
rustls = { workspace = true }
smallvec = { workspace = true }
diff --git a/core/server_common/src/memory_pool.rs
b/core/server_common/src/memory_pool.rs
index 657743c05..b55c1c64a 100644
--- a/core/server_common/src/memory_pool.rs
+++ b/core/server_common/src/memory_pool.rs
@@ -18,16 +18,15 @@
use aligned_vec::{AVec, ConstAlign};
use crossbeam::queue::ArrayQueue;
use human_repr::HumanCount;
-use once_cell::sync::OnceCell;
-use std::sync::Arc;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
+use std::sync::{Arc, OnceLock};
use tracing::{info, trace, warn};
pub const ALIGNMENT: usize = 4096;
pub type AlignedBuffer = AVec<u8, ConstAlign<4096>>;
/// Global memory pool instance. Use `memory_pool()` to access it.
-pub static MEMORY_POOL: OnceCell<MemoryPool> = OnceCell::new();
+pub static MEMORY_POOL: OnceLock<MemoryPool> = OnceLock::new();
/// Total number of distinct bucket sizes.
const NUM_BUCKETS: usize = 28;