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:
parent
37b754f462
commit
1a270361c0
9 changed files with 12 additions and 37 deletions
|
@ -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>,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue