Skip to content

Commit

Permalink
Merge "Replace lazy_static with once_cell" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Feb 9, 2024
2 parents ff239bb + 794a952 commit 22e1c5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libstats/pull_rust/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ rust_library {
crate_name: "statspull_rust",
srcs: ["stats_pull.rs"],
rustlibs: [
"liblazy_static",
"liblog_rust",
"libonce_cell",
"libstatslog_rust_header",
"libstatspull_bindgen",
],
Expand Down
7 changes: 3 additions & 4 deletions libstats/pull_rust/stats_pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

//! A Rust interface for the StatsD pull API.
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use statslog_rust_header::{Atoms, Stat, StatsError};
use statspull_bindgen::*;
use std::collections::HashMap;
Expand Down Expand Up @@ -107,9 +107,8 @@ impl Default for Metadata {
}
}

lazy_static! {
static ref COOKIES: Mutex<HashMap<i32, fn() -> StatsPullResult>> = Mutex::new(HashMap::new());
}
static COOKIES: Lazy<Mutex<HashMap<i32, fn() -> StatsPullResult>>> =
Lazy::new(|| Mutex::new(HashMap::new()));

/// # Safety
///
Expand Down

0 comments on commit 22e1c5d

Please sign in to comment.