We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description Calls to the std::env functions that use string literals instead of a static strings can lead to bugs due to spelling errors.
Consider using a static string to refer to environment variables.
Bad practice
std::env::var("RUST_BACKTRACE"); // elsewhere ... std::env::remove_var("RUST_BACKTRCAE"); // misspelled
Recommended
static RUST_BACKTRACE: &str = "RUST_BACKTRACE"; std::env::var(RUST_BACKTRACE); std::env::remove_var(RUST_BACKTRACE);
Using env::var with a string literal : https://github.com/nitro/blob/master/arbitrator/prover/build.rs#L86-L86
Using env::var with a string literal https://github.com/nitro/blob/master/arbitrator/brotli/build.rs#L7-L7
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Calls to the std::env functions that use string literals instead of a static strings can lead to bugs due to spelling errors.
Consider using a static string to refer to environment variables.
Bad practice
Recommended
Using env::var with a string literal : https://github.com/nitro/blob/master/arbitrator/prover/build.rs#L86-L86
Using env::var with a string literal https://github.com/nitro/blob/master/arbitrator/brotli/build.rs#L7-L7
The text was updated successfully, but these errors were encountered: