Remove 2 suffix from gpui
Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
3c81dda8e2
commit
f5ba22659b
225 changed files with 8511 additions and 41063 deletions
|
@ -11,12 +11,6 @@ doctest = true
|
|||
[features]
|
||||
test-support = ["tempdir", "git2"]
|
||||
|
||||
# Suppress a panic when both GPUI1 and GPUI2 are loaded.
|
||||
#
|
||||
# This is used in the `theme_importer` where we need to depend on both
|
||||
# GPUI1 and GPUI2 in order to convert Zed1 themes to Zed2 themes.
|
||||
allow-multiple-gpui-versions = []
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
backtrace = "0.3"
|
||||
|
|
|
@ -16,9 +16,6 @@ use std::{
|
|||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
#[cfg(not(feature = "allow-multiple-gpui-versions"))]
|
||||
use std::sync::atomic::AtomicU32;
|
||||
|
||||
pub use backtrace::Backtrace;
|
||||
use futures::Future;
|
||||
use rand::{seq::SliceRandom, Rng};
|
||||
|
@ -436,23 +433,6 @@ impl<T: Ord + Clone> RangeExt<T> for RangeInclusive<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "allow-multiple-gpui-versions"))]
|
||||
static GPUI_LOADED: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
pub fn gpui2_loaded() {
|
||||
#[cfg(not(feature = "allow-multiple-gpui-versions"))]
|
||||
if GPUI_LOADED.fetch_add(2, std::sync::atomic::Ordering::SeqCst) != 0 {
|
||||
panic!("=========\nYou are loading both GPUI1 and GPUI2 in the same build!\nFix Your Dependencies with cargo tree!\n=========")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn gpui1_loaded() {
|
||||
#[cfg(not(feature = "allow-multiple-gpui-versions"))]
|
||||
if GPUI_LOADED.fetch_add(1, std::sync::atomic::Ordering::SeqCst) != 0 {
|
||||
panic!("=========\nYou are loading both GPUI1 and GPUI2 in the same build!\nFix Your Dependencies with cargo tree!\n=========")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue