We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f00f07 commit 747bb24Copy full SHA for 747bb24
clippy_lints/src/use_unwrap_or.rs
@@ -41,10 +41,10 @@ impl<'tcx> LateLintPass<'tcx> for UseUnwrapOr {
41
// look for x.or().unwrap()
42
if_chain! {
43
if let ExprKind::MethodCall(path, args, unwrap_span) = expr.kind;
44
- if path.ident.name.as_str() == "unwrap";
+ if path.ident.name == sym::unwrap;
45
if let Some(caller) = args.first();
46
if let ExprKind::MethodCall(caller_path, caller_args, or_span) = caller.kind;
47
- if caller_path.ident.name.as_str() == "or";
+ if caller_path.ident.name == sym::or;
48
then {
49
let ty = cx.typeck_results().expr_ty(&caller_args[0]); // get type of x (we later check if it's Option or Result)
50
let title;
0 commit comments