Skip to content

Commit b70fe1b

Browse files
committed
Use std::sync::LazyLock rather than once_cell.
This was recently stabilised in Rust 1.80. Test: Treehugger Change-Id: I3748566599fb7bb63a7fa14a604b1405406c519c
1 parent 3246b97 commit b70fe1b

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

libs/debugstore/rust/Android.bp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ rust_defaults {
2323
rustlibs: [
2424
"libcrossbeam_queue",
2525
"libparking_lot",
26-
"libonce_cell",
2726
"libcxx",
2827
],
2928
shared_libs: ["libutils"],

libs/debugstore/rust/src/core.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ use super::event::Event;
1717
use super::event_type::EventType;
1818
use super::storage::Storage;
1919
use crate::cxxffi::uptimeMillis;
20-
use once_cell::sync::Lazy;
2120
use std::fmt;
22-
use std::sync::atomic::{AtomicU64, Ordering};
21+
use std::sync::{
22+
atomic::{AtomicU64, Ordering},
23+
LazyLock,
24+
};
2325

2426
// Lazily initialized static instance of DebugStore.
25-
static INSTANCE: Lazy<DebugStore> = Lazy::new(DebugStore::new);
27+
static INSTANCE: LazyLock<DebugStore> = LazyLock::new(DebugStore::new);
2628

2729
/// The `DebugStore` struct is responsible for managing debug events and data.
2830
pub struct DebugStore {

0 commit comments

Comments
 (0)