methods: allow Option.unwrap by default
This commit is contained in:
parent
1afc5b6235
commit
137a9f3def
@ -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_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
|
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
|
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)`
|
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
|
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`)
|
redundant_closure | warn | using redundant closures, i.e. `|a| foo(a)` (which can be written as just `foo`)
|
||||||
|
@ -7,7 +7,7 @@ use utils::{span_lint, match_def_path, walk_ptrs_ty};
|
|||||||
#[derive(Copy,Clone)]
|
#[derive(Copy,Clone)]
|
||||||
pub struct MethodsPass;
|
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()`");
|
"using `Option.unwrap()`, which should at least get a better message using `expect()`");
|
||||||
declare_lint!(pub RESULT_UNWRAP_USED, Allow,
|
declare_lint!(pub RESULT_UNWRAP_USED, Allow,
|
||||||
"using `Result.unwrap()`, which might be better handled");
|
"using `Result.unwrap()`, which might be better handled");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user