hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

8.9K
active users

A Rust question. Command::env_clear() has this example:

use std::process::Command;

Command::new("ls")
.env_clear()
.spawn()
.expect("ls command failed to start");

Isn't that like "do nothing" given that the instance Command was just created? I don't understand this example.

#rust #rustlang
aburka 🫣

@jarkko this is demonstrating the second part of the function's effect, "[...] and prevents inheriting any parent process environment variables"