mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-13 07:11:12 -03:00
Replace OnceLock<()> with better(?) alternatives
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::global_safety::RelaxedAtomicBool;
|
||||
// Generic output functions.
|
||||
use crate::prelude::*;
|
||||
use crate::{
|
||||
@@ -14,10 +15,7 @@
|
||||
cell::{RefCell, RefMut},
|
||||
ops::{Deref, DerefMut},
|
||||
os::{fd::RawFd, unix::ffi::OsStrExt as _},
|
||||
sync::{
|
||||
OnceLock,
|
||||
atomic::{AtomicU8, Ordering},
|
||||
},
|
||||
sync::atomic::{AtomicU8, Ordering},
|
||||
};
|
||||
|
||||
bitflags! {
|
||||
@@ -189,8 +187,8 @@ fn osc_133_prompt_start(out: &mut Outputter) -> bool {
|
||||
if !fish_feature_flags::feature_test(FeatureFlag::MarkPrompt) {
|
||||
return false;
|
||||
}
|
||||
static TEST_BALLOON: OnceLock<()> = OnceLock::new();
|
||||
if TEST_BALLOON.set(()).is_ok() {
|
||||
static TEST_BALLOON: RelaxedAtomicBool = RelaxedAtomicBool::new(false);
|
||||
if !TEST_BALLOON.swap(true) {
|
||||
write_to_output!(out, "\x1b]133;A;click_events=1\x1b\\");
|
||||
} else {
|
||||
write_to_output!(out, "\x1b]133;A;click_events=1\x07");
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
use std::collections::HashMap;
|
||||
use std::env::set_current_dir;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::OnceLock;
|
||||
|
||||
pub use serial_test::serial;
|
||||
|
||||
pub fn test_init() {
|
||||
static DONE: OnceLock<()> = OnceLock::new();
|
||||
DONE.get_or_init(|| {
|
||||
static DONE: std::sync::Once = std::sync::Once::new();
|
||||
DONE.call_once(|| {
|
||||
// If we are building with `cargo build` and have build w/ `cmake`, this might not
|
||||
// yet exist.
|
||||
let mut test_dir = PathBuf::from(BUILD_DIR);
|
||||
|
||||
Reference in New Issue
Block a user