From 4de7c8e542c38ff8ec125493d5874e8a25650b86 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 5 Jan 2023 19:32:55 +0100 Subject: [PATCH] Removed once_cell crate as of latest Rust changes --- ctru-rs/Cargo.toml | 1 - ctru-rs/src/gfx.rs | 3 +-- ctru-rs/src/romfs.rs | 3 +-- ctru-rs/src/services/ndsp/mod.rs | 3 +-- ctru-rs/src/services/soc.rs | 3 +-- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index f824d6d..7ba8003 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -20,7 +20,6 @@ pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" } libc = "0.2.121" bitflags = "1.0.0" widestring = "0.2.2" -once_cell = "1.10.0" [build-dependencies] toml = "0.5" diff --git a/ctru-rs/src/gfx.rs b/ctru-rs/src/gfx.rs index 2e83832..09fa5ba 100644 --- a/ctru-rs/src/gfx.rs +++ b/ctru-rs/src/gfx.rs @@ -1,6 +1,5 @@ //! LCD screens manipulation helper -use once_cell::sync::Lazy; use std::cell::{Ref, RefCell, RefMut}; use std::marker::PhantomData; use std::sync::Mutex; @@ -126,7 +125,7 @@ pub struct Gfx { _service_handler: ServiceReference, } -static GFX_ACTIVE: Lazy> = Lazy::new(|| Mutex::new(0)); +static GFX_ACTIVE: Mutex = Mutex::new(0); impl Gfx { /// Initialize the Gfx module with the chosen framebuffer formats for the top and bottom diff --git a/ctru-rs/src/romfs.rs b/ctru-rs/src/romfs.rs index 2a3def2..9d8a555 100644 --- a/ctru-rs/src/romfs.rs +++ b/ctru-rs/src/romfs.rs @@ -11,7 +11,6 @@ //! ``` use crate::error::ResultCode; -use once_cell::sync::Lazy; use std::ffi::CStr; use std::sync::Mutex; @@ -22,7 +21,7 @@ pub struct RomFS { _service_handler: ServiceReference, } -static ROMFS_ACTIVE: Lazy> = Lazy::new(|| Mutex::new(0)); +static ROMFS_ACTIVE: Mutex = Mutex::new(0); impl RomFS { pub fn init() -> crate::Result { diff --git a/ctru-rs/src/services/ndsp/mod.rs b/ctru-rs/src/services/ndsp/mod.rs index 4c63f47..b8d155f 100644 --- a/ctru-rs/src/services/ndsp/mod.rs +++ b/ctru-rs/src/services/ndsp/mod.rs @@ -4,7 +4,6 @@ use wave::{WaveInfo, WaveStatus}; use crate::error::ResultCode; use crate::services::ServiceReference; -use once_cell::sync::Lazy; use std::sync::Mutex; #[derive(Copy, Clone, Debug)] @@ -39,7 +38,7 @@ pub struct Channel { id: i32, } -static NDSP_ACTIVE: Lazy> = Lazy::new(|| Mutex::new(0)); +static NDSP_ACTIVE: Mutex = Mutex::new(0); #[non_exhaustive] pub struct Ndsp { diff --git a/ctru-rs/src/services/soc.rs b/ctru-rs/src/services/soc.rs index 88fb4aa..5d8d849 100644 --- a/ctru-rs/src/services/soc.rs +++ b/ctru-rs/src/services/soc.rs @@ -1,5 +1,4 @@ use libc::memalign; -use once_cell::sync::Lazy; use std::net::Ipv4Addr; use std::sync::Mutex; @@ -15,7 +14,7 @@ pub struct Soc { sock_3dslink: libc::c_int, } -static SOC_ACTIVE: Lazy> = Lazy::new(|| Mutex::new(0)); +static SOC_ACTIVE: Mutex = Mutex::new(0); impl Soc { /// Initialize the Soc service with a default buffer size of 0x100000 bytes