summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Schaefer <heiko@schaefer.name>2022-10-07 11:19:23 +0200
committerHeiko Schaefer <heiko@schaefer.name>2022-10-07 11:53:03 +0200
commitf4b3b79ee08fe04c8aa690115de854f06572f729 (patch)
tree6cf822187620153bd0d541ae44002f47d407e2e1
parent7936e3513ee339650a7ac2eff11edd2fac3f037d (diff)
Disable clippy lint unnecessary_lazy_evaluations.
Resolves #935 (in which Neal argues: "the programmer always has to use a performance heuristic to determine whether to use unwrap_or or unwrap_or_else. The heuristic should be as simple as possible to reduce the programmer's cognitive burden and allow them to concentrate on the task at hand. A simple heuristic is: if the value is a literal, use unwrap_or otherwise use unwrap_or_else. This is reasonable given that the cost of using .unwrap_or_else(|| literal) instead of .unwrap_or(literal) is effectively zero; it is never wrong from a performance perspective to use unwrap_or_else instead of unwrap_or, but it can be wrong to use unwrap_or instead of unwrap_or_else.")
-rw-r--r--.cargo/config.toml1
1 files changed, 1 insertions, 0 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml
index d6533ecf..3e57a8d6 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -8,4 +8,5 @@ rustflags = [
"-Aclippy::needless-question-mark",
"-Aclippy::redundant-clone",
"-Aclippy::try-err",
+ "-Aclippy::unnecessary-lazy-evaluations",
]