From 1a6312ee0f667d0c31ceb37b7304e86c924899fd Mon Sep 17 00:00:00 2001 From: Cameron Steffen Date: Sun, 16 Jan 2022 15:58:54 -0600 Subject: [PATCH] Format clippy --- src/tools/clippy/clippy_lints/src/non_copy_const.rs | 5 +---- src/tools/clippy/clippy_lints/src/redundant_clone.rs | 5 +---- src/tools/clippy/clippy_lints/src/unnecessary_sort_by.rs | 5 +---- src/tools/clippy/clippy_utils/src/consts.rs | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/tools/clippy/clippy_lints/src/non_copy_const.rs b/src/tools/clippy/clippy_lints/src/non_copy_const.rs index afc356d1ab2..21ac6548b01 100644 --- a/src/tools/clippy/clippy_lints/src/non_copy_const.rs +++ b/src/tools/clippy/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/src/tools/clippy/clippy_lints/src/redundant_clone.rs b/src/tools/clippy/clippy_lints/src/redundant_clone.rs index dce1f66107a..3e0e32857f1 100644 --- a/src/tools/clippy/clippy_lints/src/redundant_clone.rs +++ b/src/tools/clippy/clippy_lints/src/redundant_clone.rs @@ -624,10 +624,7 @@ fn visit_terminator(&mut self, terminator: &mir::Terminator<'_>, _loc: mir::Loca .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/src/tools/clippy/clippy_lints/src/unnecessary_sort_by.rs b/src/tools/clippy/clippy_lints/src/unnecessary_sort_by.rs index 32adccdbd1c..7d75ff36e97 100644 --- a/src/tools/clippy/clippy_lints/src/unnecessary_sort_by.rs +++ b/src/tools/clippy/clippy_lints/src/unnecessary_sort_by.rs @@ -224,10 +224,7 @@ fn detect_lint(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { 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 { diff --git a/src/tools/clippy/clippy_utils/src/consts.rs b/src/tools/clippy/clippy_utils/src/consts.rs index e09a663538d..34c5af848a6 100644 --- a/src/tools/clippy/clippy_utils/src/consts.rs +++ b/src/tools/clippy/clippy_utils/src/consts.rs @@ -413,10 +413,7 @@ fn fetch_path(&mut self, qpath: &QPath<'_>, id: HirId, ty: Ty<'tcx>) -> Option