From 65fe6727daa588c659620282b42483818918c6b4 Mon Sep 17 00:00:00 2001 From: Eric Walker Date: Tue, 2 Jul 2024 08:43:35 -0400 Subject: [PATCH] Use configuration for loading cryptox --- crates/config/src/lib.rs | 2 ++ crates/core/src/runtime.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 8836b9e2..f1dcbbfd 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -31,6 +31,7 @@ bitflags! { const JAVY_STREAM_IO = 1 << 2; const REDIRECT_STDOUT_TO_STDERR = 1 << 3; const TEXT_ENCODING = 1 << 4; + const JAVY_CRYPTOX = 1 << 5; } } @@ -44,5 +45,6 @@ mod tests { assert!(Config::JAVY_STREAM_IO == Config::from_bits(1 << 2).unwrap()); assert!(Config::REDIRECT_STDOUT_TO_STDERR == Config::from_bits(1 << 3).unwrap()); assert!(Config::TEXT_ENCODING == Config::from_bits(1 << 4).unwrap()); + assert!(Config::JAVY_CRYPTOX == Config::from_bits(1 << 5).unwrap()); } } diff --git a/crates/core/src/runtime.rs b/crates/core/src/runtime.rs index ee366cd8..1e52c74b 100644 --- a/crates/core/src/runtime.rs +++ b/crates/core/src/runtime.rs @@ -13,7 +13,7 @@ pub(crate) fn new(shared_config: SharedConfig) -> Result { // fix forward. .override_json_parse_and_stringify(false) .javy_json(false) - .javy_cryptox(true); + .javy_cryptox(shared_config.contains(SharedConfig::JAVY_CRYPTOX)); Runtime::new(std::mem::take(config)) }