Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a957469 authored by Andrew Walbran's avatar Andrew Walbran
Browse files

No need for lazy_static as Mutex::new is now const.

This changed in Rust 1.63.

Bug: 242288711
Test: m virtualizationservice
Change-Id: I07fc300f85a2890656b1c091f68a9d47f4802e0c
parent 1884da10
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ rust_library {
    rustlibs: [
        "libbinder_ndk_sys",
        "libdowncast_rs",
        "liblazy_static",
        "liblibc",
    ],
    host_supported: true,
@@ -160,7 +159,6 @@ rust_test {
    rustlibs: [
        "libbinder_ndk_sys",
        "libdowncast_rs",
        "liblazy_static",
        "liblibc",
    ],
}
+2 −5
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ use crate::parcel::{BorrowedParcel, Serialize};
use crate::proxy::SpIBinder;
use crate::sys;

use lazy_static::lazy_static;
use std::convert::TryFrom;
use std::ffi::{c_void, CStr, CString};
use std::fs::File;
@@ -508,10 +507,8 @@ pub struct LazyServiceGuard {
    _private: (),
}

lazy_static! {
// Count of how many LazyServiceGuard objects are in existence.
    static ref GUARD_COUNT: Mutex<u64> = Mutex::new(0);
}
static GUARD_COUNT: Mutex<u64> = Mutex::new(0);

impl LazyServiceGuard {
    /// Create a new LazyServiceGuard to prevent the service manager prematurely killing this