refactor(tvix/eval): remove usage of lazy_static

Equivalent logic is now in the standard library, and this dependency is no
longer needed for eval.

Change-Id: Iaa4410d89fdaa5b84cbd9e6bc6ae479c659d92f2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12602
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: edef <edef@edef.eu>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2024-10-13 01:30:24 +03:00 committed by clbot
parent b7a6fc2812
commit b21cb11b7f
6 changed files with 26 additions and 38 deletions

View file

@ -5,6 +5,7 @@ use std::fmt::Display;
use std::num::{NonZeroI32, NonZeroUsize};
use std::path::PathBuf;
use std::rc::Rc;
use std::sync::LazyLock;
use bstr::{BString, ByteVec};
use codemap::Span;
@ -37,8 +38,6 @@ pub use thunk::Thunk;
pub use self::thunk::ThunkSet;
use lazy_static::lazy_static;
#[warn(variant_size_differences)]
#[derive(Clone, Debug, Deserialize)]
#[serde(untagged)]
@ -107,16 +106,15 @@ where
}
}
lazy_static! {
static ref WRITE_FLOAT_OPTIONS: lexical_core::WriteFloatOptions =
lexical_core::WriteFloatOptionsBuilder::new()
.trim_floats(true)
.round_mode(lexical_core::write_float_options::RoundMode::Round)
.positive_exponent_break(Some(NonZeroI32::new(5).unwrap()))
.max_significant_digits(Some(NonZeroUsize::new(6).unwrap()))
.build()
.unwrap();
}
static WRITE_FLOAT_OPTIONS: LazyLock<lexical_core::WriteFloatOptions> = LazyLock::new(|| {
lexical_core::WriteFloatOptionsBuilder::new()
.trim_floats(true)
.round_mode(lexical_core::write_float_options::RoundMode::Round)
.positive_exponent_break(Some(NonZeroI32::new(5).unwrap()))
.max_significant_digits(Some(NonZeroUsize::new(6).unwrap()))
.build()
.unwrap()
});
// Helper macros to generate the to_*/as_* macros while accounting for
// thunks.