Skip to content

Commit a80ae4d

Browse files
author
Travis CI
committed
Automatic deploy to GitHub Pages: c066807
1 parent 52e035b commit a80ae4d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

master/lints.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,17 @@
762762
"id": "unnecessary_filter_map",
763763
"level": "Warn"
764764
},
765+
{
766+
"docs": {
767+
"What it does": "Checks for usage of `option_env!(...).unwrap()` and\nsuggests usage of the `env!` macro.",
768+
"Why is this bad": "Unwrapping the result of `option_env!` will panic\nat run-time if the environment variable doesn't exist, whereas `env!`\ncatches it at compile-time.",
769+
"Known problems": "None.",
770+
"Example": "```rust,no_run\nlet _ = option_env!(\"HOME\").unwrap();\n```\n\nIs better expressed as:\n\n```rust,no_run\nlet _ = env!(\"HOME\");\n```"
771+
},
772+
"group": "correctness",
773+
"id": "option_env_unwrap",
774+
"level": "Deny"
775+
},
765776
{
766777
"docs": {
767778
"What it does": "Checks for usage of `_.filter(_).next()`.",

0 commit comments

Comments
 (0)