diff options
| author | Cameron Steffen <cam.steffen94@gmail.com> | 2022-01-16 15:58:54 -0600 |
|---|---|---|
| committer | Cameron Steffen <cam.steffen94@gmail.com> | 2022-01-16 16:02:36 -0600 |
| commit | 94dd91524b4ad99dcb31ac250398b557bbbc7c96 (patch) | |
| tree | 117fadabf302d0bbd6a8cdeb2efec381b7ab7b91 /clippy_lints | |
| parent | f4a88f23c1bc796153f92d95b3f1b5660c0eee99 (diff) | |
Format clippy
Diffstat (limited to 'clippy_lints')
| -rw-r--r-- | clippy_lints/src/non_copy_const.rs | 5 | ||||
| -rw-r--r-- | clippy_lints/src/redundant_clone.rs | 5 | ||||
| -rw-r--r-- | clippy_lints/src/unnecessary_sort_by.rs | 5 |
3 files changed, 3 insertions, 12 deletions
diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index afc356d1ab2..21ac6548b01 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -188,10 +188,7 @@ fn is_value_unfrozen_expr<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId, def_id: D let result = cx.tcx.const_eval_resolve( cx.param_env, - ty::Unevaluated::new( - ty::WithOptConstParam::unknown(def_id), - substs, - ), + ty::Unevaluated::new(ty::WithOptConstParam::unknown(def_id), substs), None, ); is_value_unfrozen_raw(cx, result, ty) diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index dce1f66107a..3e0e32857f1 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -624,10 +624,7 @@ impl<'a, 'tcx> mir::visit::Visitor<'tcx> for PossibleBorrowerVisitor<'a, 'tcx> { .flat_map(HybridBitSet::iter) .collect(); - if ContainsRegion - .visit_ty(self.body.local_decls[*dest].ty) - .is_break() - { + if ContainsRegion.visit_ty(self.body.local_decls[*dest].ty).is_break() { mutable_variables.push(*dest); } diff --git a/clippy_lints/src/unnecessary_sort_by.rs b/clippy_lints/src/unnecessary_sort_by.rs index 32adccdbd1c..7d75ff36e97 100644 --- a/clippy_lints/src/unnecessary_sort_by.rs +++ b/clippy_lints/src/unnecessary_sort_by.rs @@ -224,10 +224,7 @@ fn detect_lint(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<LintTrigger> { fn expr_borrows(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { let ty = cx.typeck_results().expr_ty(expr); - matches!(ty.kind(), ty::Ref(..)) - || ty - .walk() - .any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_))) + matches!(ty.kind(), ty::Ref(..)) || ty.walk().any(|arg| matches!(arg.unpack(), GenericArgKind::Lifetime(_))) } impl LateLintPass<'_> for UnnecessarySortBy { |
