From 137a9f3def7d4d420e9359d36efe52f8d3e42c9e Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 14 Aug 2015 07:17:10 +0200 Subject: [PATCH] methods: allow Option.unwrap by default --- README.md | 2 +- src/methods.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd7d0158f03..d9dea816318 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ needless_lifetimes | warn | using explicit lifetimes for references in func needless_range_loop | warn | for-looping over a range of indices where an iterator over items would do needless_return | warn | using a return statement like `return expr;` where an expression would suffice non_ascii_literal | allow | using any literal non-ASCII chars in a string literal; suggests using the \\u escape instead -option_unwrap_used | warn | using `Option.unwrap()`, which should at least get a better message using `expect()` +option_unwrap_used | allow | using `Option.unwrap()`, which should at least get a better message using `expect()` precedence | warn | expressions where precedence may trip up the unwary reader of the source; suggests adding parentheses, e.g. `x << 2 + y` will be parsed as `x << (2 + y)` ptr_arg | allow | fn arguments of the type `&Vec<...>` or `&String`, suggesting to use `&[...]` or `&str` instead, respectively redundant_closure | warn | using redundant closures, i.e. `|a| foo(a)` (which can be written as just `foo`) diff --git a/src/methods.rs b/src/methods.rs index 07b0fdf70e2..02b181a46e7 100644 --- a/src/methods.rs +++ b/src/methods.rs @@ -7,7 +7,7 @@ use utils::{span_lint, match_def_path, walk_ptrs_ty}; #[derive(Copy,Clone)] pub struct MethodsPass; -declare_lint!(pub OPTION_UNWRAP_USED, Warn, +declare_lint!(pub OPTION_UNWRAP_USED, Allow, "using `Option.unwrap()`, which should at least get a better message using `expect()`"); declare_lint!(pub RESULT_UNWRAP_USED, Allow, "using `Result.unwrap()`, which might be better handled");