Skip to content

Commit

Permalink
std::env:set_var is unsafe and should be avoided
Browse files Browse the repository at this point in the history
  • Loading branch information
hrxi authored and jsdanielh committed Jun 28, 2024
1 parent 788e140 commit 0ad61e6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pow-migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,16 @@ pub fn launch_pos_client(
config_file: &str,
genesis_env_var_name: &str,
) -> Result<ExitStatus, Error> {
// Start the nimiq PoS client with the generated genesis file
log::info!(
filename = ?genesis_file,
"Launching PoS client with generated genesis"
);

// Set the genesis file environment variable
std::env::set_var(genesis_env_var_name, genesis_file);

// Launch the PoS client
let mut child = match Command::new(pos_client_path)
.arg("-c")
.arg(config_file)
.env(genesis_env_var_name, genesis_file)
.spawn()
{
Ok(child) => child,
Expand Down

0 comments on commit 0ad61e6

Please sign in to comment.