summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-09-25 12:40:25 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2024-09-25 12:40:25 +0000
commitf3c911a9d18b362d8209350811dfba5d4eab3db0 (patch)
treef9e62231e0e371acbd742a7711ace195056d14dd
parent3aeff205e1917b2646dc0b7a86c0fe6a2e37826f (diff)
parentd1ffcf652a451c535caced93ef2a853c611baf13 (diff)
Merge "Use std::sync::LazyLock rather than once_cell." into main am: 12016e29e9 am: d1ffcf652a
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3271676 Change-Id: I34f989d45834de41c24cd63b525d2d4bee09217a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/debugstore/rust/Android.bp1
-rw-r--r--libs/debugstore/rust/src/core.rs8
2 files changed, 5 insertions, 4 deletions
diff --git a/libs/debugstore/rust/Android.bp b/libs/debugstore/rust/Android.bp
index 55ba3c32d1..9475333a72 100644
--- a/libs/debugstore/rust/Android.bp
+++ b/libs/debugstore/rust/Android.bp
@@ -23,7 +23,6 @@ rust_defaults {
rustlibs: [
"libcrossbeam_queue",
"libparking_lot",
- "libonce_cell",
"libcxx",
],
shared_libs: ["libutils"],
diff --git a/libs/debugstore/rust/src/core.rs b/libs/debugstore/rust/src/core.rs
index 1dfa512151..6bf79d4e57 100644
--- a/libs/debugstore/rust/src/core.rs
+++ b/libs/debugstore/rust/src/core.rs
@@ -17,12 +17,14 @@ use super::event::Event;
use super::event_type::EventType;
use super::storage::Storage;
use crate::cxxffi::uptimeMillis;
-use once_cell::sync::Lazy;
use std::fmt;
-use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::{
+ atomic::{AtomicU64, Ordering},
+ LazyLock,
+};
// Lazily initialized static instance of DebugStore.
-static INSTANCE: Lazy<DebugStore> = Lazy::new(DebugStore::new);
+static INSTANCE: LazyLock<DebugStore> = LazyLock::new(DebugStore::new);
/// The `DebugStore` struct is responsible for managing debug events and data.
pub struct DebugStore {