diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2023-07-12 21:49:27 -0400 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2023-07-12 21:49:27 -0400 |
| commit | cc907f80b95c6ec530c5ee1b05b044a468f07eca (patch) | |
| tree | 47015a30be181fdb089b7daa4b8f18e9bb1d62f2 /compiler/rustc_lint/src/noop_method_call.rs | |
| parent | 67b0cfc761c9ad31a1dbacca36c42803b255f17a (diff) | |
| download | rust-cc907f80b95c6ec530c5ee1b05b044a468f07eca.tar.gz rust-cc907f80b95c6ec530c5ee1b05b044a468f07eca.zip | |
Re-format let-else per rustfmt update
Diffstat (limited to 'compiler/rustc_lint/src/noop_method_call.rs')
| -rw-r--r-- | compiler/rustc_lint/src/noop_method_call.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs index d56c35bb677..79430393a64 100644 --- a/compiler/rustc_lint/src/noop_method_call.rs +++ b/compiler/rustc_lint/src/noop_method_call.rs @@ -79,8 +79,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall { // We only care about method calls corresponding to the `Clone`, `Deref` and `Borrow` // traits and ignore any other method call. - let Some((DefKind::AssocFn, did)) = - cx.typeck_results().type_dependent_def(expr.hir_id) + let Some((DefKind::AssocFn, did)) = cx.typeck_results().type_dependent_def(expr.hir_id) else { return; }; @@ -98,9 +97,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall { .tcx .normalize_erasing_regions(cx.param_env, cx.typeck_results().node_substs(expr.hir_id)); // Resolve the trait method instance. - let Ok(Some(i)) = ty::Instance::resolve(cx.tcx, cx.param_env, did, substs) else { - return - }; + let Ok(Some(i)) = ty::Instance::resolve(cx.tcx, cx.param_env, did, substs) else { return }; // (Re)check that it implements the noop diagnostic. let Some(name) = cx.tcx.get_diagnostic_name(i.def_id()) else { return }; |
