1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

Replace lazy_static with once_cell

This commit is contained in:
Jamie Quigley 2022-07-12 14:08:18 +01:00
parent 37b754f462
commit 1a270361c0
No known key found for this signature in database
GPG key ID: 8E8FF66E2AE8D970
9 changed files with 12 additions and 37 deletions

View file

@ -1,4 +1,5 @@
use crate::common::util::*;
use once_cell::sync::Lazy;
use std::fs::{metadata, set_permissions, OpenOptions, Permissions};
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
use std::sync::Mutex;
@ -11,9 +12,7 @@ use self::libc::umask;
static TEST_FILE: &str = "file";
static REFERENCE_FILE: &str = "reference";
static REFERENCE_PERMS: u32 = 0o247;
lazy_static! {
static ref UMASK_MUTEX: Mutex<()> = Mutex::new(());
}
static UMASK_MUTEX: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
struct TestCase {
args: Vec<&'static str>,

View file

@ -18,16 +18,9 @@ use std::os::unix::io::IntoRawFd;
use std::path::Path;
#[cfg(not(windows))]
use std::path::PathBuf;
#[cfg(not(windows))]
use std::sync::Mutex;
use std::thread::sleep;
use std::time::Duration;
#[cfg(not(windows))]
lazy_static! {
static ref UMASK_MUTEX: Mutex<()> = Mutex::new(());
}
const LONG_ARGS: &[&str] = &[
"-l",
"--long",

View file

@ -1,11 +1,6 @@
#[macro_use]
mod common;
#[allow(unused_imports)]
#[cfg(unix)]
#[macro_use]
extern crate lazy_static;
#[cfg(unix)]
extern crate rust_users;