From b1b7727e046b4b25dcca034ee767a7fc3238409d Mon Sep 17 00:00:00 2001 From: Anatol Liu Date: Thu, 12 Nov 2020 17:48:07 -0800 Subject: add open Cargo.toml action --- crates/hir_ty/src/tests.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/tests.rs b/crates/hir_ty/src/tests.rs index 104ef334c..0a400cb70 100644 --- a/crates/hir_ty/src/tests.rs +++ b/crates/hir_ty/src/tests.rs @@ -22,7 +22,8 @@ use hir_def::{ AssocItemId, DefWithBodyId, LocalModuleId, Lookup, ModuleDefId, }; use hir_expand::{db::AstDatabase, InFile}; -use stdx::{format_to, RacyFlag}; +use once_cell::race::OnceBool; +use stdx::format_to; use syntax::{ algo, ast::{self, AstNode}, @@ -40,8 +41,8 @@ use crate::{ // `env UPDATE_EXPECT=1 cargo test -p hir_ty` to update the snapshots. fn setup_tracing() -> Option { - static ENABLE: RacyFlag = RacyFlag::new(); - if !ENABLE.get(|| env::var("CHALK_DEBUG").is_ok()) { + static ENABLE: OnceBool = OnceBool::new(); + if !ENABLE.get_or_init(|| env::var("CHALK_DEBUG").is_ok()) { return None; } -- cgit v1.2.3