Skip to content

Commit

Permalink
Use configuration for loading cryptox
Browse files Browse the repository at this point in the history
  • Loading branch information
ewalk153 committed Jul 2, 2024
1 parent f4cdfc0 commit 65fe672
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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());
}
}
2 changes: 1 addition & 1 deletion crates/core/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) fn new(shared_config: SharedConfig) -> Result<Runtime> {
// 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))
}

0 comments on commit 65fe672

Please sign in to comment.