Rust

Rust

Made by DeepSource

Called unwrap on option_env! macro RS-W1016

Bug risk
Major

Unwrapping the result of the option_env! macro will panic at runtime if the environment variable does not exist. The env! macro catches this at compile time.

Replace the call to option_env!(...).unwrap() with env!(...).

Bad practice

option_env!("HOME").unwrap();

Recommended

env!("HOME");