Browse Source

Removed once_cell crate as of latest Rust changes

pull/83/head
Andrea Ciliberti 2 years ago
parent
commit
4de7c8e542
  1. 1
      ctru-rs/Cargo.toml
  2. 3
      ctru-rs/src/gfx.rs
  3. 3
      ctru-rs/src/romfs.rs
  4. 3
      ctru-rs/src/services/ndsp/mod.rs
  5. 3
      ctru-rs/src/services/soc.rs

1
ctru-rs/Cargo.toml

@ -20,7 +20,6 @@ pthread-3ds = { git = "https://github.com/rust3ds/pthread-3ds.git" }
libc = "0.2.121" libc = "0.2.121"
bitflags = "1.0.0" bitflags = "1.0.0"
widestring = "0.2.2" widestring = "0.2.2"
once_cell = "1.10.0"
[build-dependencies] [build-dependencies]
toml = "0.5" toml = "0.5"

3
ctru-rs/src/gfx.rs

@ -1,6 +1,5 @@
//! LCD screens manipulation helper //! LCD screens manipulation helper
use once_cell::sync::Lazy;
use std::cell::{Ref, RefCell, RefMut}; use std::cell::{Ref, RefCell, RefMut};
use std::marker::PhantomData; use std::marker::PhantomData;
use std::sync::Mutex; use std::sync::Mutex;
@ -126,7 +125,7 @@ pub struct Gfx {
_service_handler: ServiceReference, _service_handler: ServiceReference,
} }
static GFX_ACTIVE: Lazy<Mutex<usize>> = Lazy::new(|| Mutex::new(0)); static GFX_ACTIVE: Mutex<usize> = Mutex::new(0);
impl Gfx { impl Gfx {
/// Initialize the Gfx module with the chosen framebuffer formats for the top and bottom /// Initialize the Gfx module with the chosen framebuffer formats for the top and bottom

3
ctru-rs/src/romfs.rs

@ -11,7 +11,6 @@
//! ``` //! ```
use crate::error::ResultCode; use crate::error::ResultCode;
use once_cell::sync::Lazy;
use std::ffi::CStr; use std::ffi::CStr;
use std::sync::Mutex; use std::sync::Mutex;
@ -22,7 +21,7 @@ pub struct RomFS {
_service_handler: ServiceReference, _service_handler: ServiceReference,
} }
static ROMFS_ACTIVE: Lazy<Mutex<usize>> = Lazy::new(|| Mutex::new(0)); static ROMFS_ACTIVE: Mutex<usize> = Mutex::new(0);
impl RomFS { impl RomFS {
pub fn init() -> crate::Result<Self> { pub fn init() -> crate::Result<Self> {

3
ctru-rs/src/services/ndsp/mod.rs

@ -4,7 +4,6 @@ use wave::{WaveInfo, WaveStatus};
use crate::error::ResultCode; use crate::error::ResultCode;
use crate::services::ServiceReference; use crate::services::ServiceReference;
use once_cell::sync::Lazy;
use std::sync::Mutex; use std::sync::Mutex;
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
@ -39,7 +38,7 @@ pub struct Channel {
id: i32, id: i32,
} }
static NDSP_ACTIVE: Lazy<Mutex<usize>> = Lazy::new(|| Mutex::new(0)); static NDSP_ACTIVE: Mutex<usize> = Mutex::new(0);
#[non_exhaustive] #[non_exhaustive]
pub struct Ndsp { pub struct Ndsp {

3
ctru-rs/src/services/soc.rs

@ -1,5 +1,4 @@
use libc::memalign; use libc::memalign;
use once_cell::sync::Lazy;
use std::net::Ipv4Addr; use std::net::Ipv4Addr;
use std::sync::Mutex; use std::sync::Mutex;
@ -15,7 +14,7 @@ pub struct Soc {
sock_3dslink: libc::c_int, sock_3dslink: libc::c_int,
} }
static SOC_ACTIVE: Lazy<Mutex<usize>> = Lazy::new(|| Mutex::new(0)); static SOC_ACTIVE: Mutex<usize> = Mutex::new(0);
impl Soc { impl Soc {
/// Initialize the Soc service with a default buffer size of 0x100000 bytes /// Initialize the Soc service with a default buffer size of 0x100000 bytes

Loading…
Cancel
Save