Skip to content

Commit 43fdbd3

Browse files
committed
Fix pretty fallout
1 parent d716129 commit 43fdbd3

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

clippy_lints/src/enum_variants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl EarlyLintPass for EnumVariantNames {
232232
if let Some(&(ref mod_name, ref mod_camel)) = self.modules.last() {
233233
// constants don't have surrounding modules
234234
if !mod_camel.is_empty() {
235-
if mod_name == &item_name {
235+
if *mod_name == item_name {
236236
if let ItemKind::Mod(..) = item.node {
237237
span_lint(cx,
238238
MODULE_INCEPTION,

clippy_lints/src/needless_pass_by_value.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
8787
let fn_sig = cx.tcx.item_type(fn_def_id).fn_sig();
8888
let fn_sig = cx.tcx.liberate_late_bound_regions(param_env.free_id_outlive, &fn_sig);
8989

90-
for ((input, ty), arg) in decl.inputs.iter().zip(fn_sig.inputs()).zip(&body.arguments) {
90+
for ((input, &ty), arg) in decl.inputs.iter().zip(fn_sig.inputs()).zip(&body.arguments) {
9191

9292
// Determines whether `ty` implements `Borrow<U>` (U != ty) specifically.
9393
// This is needed due to the `Borrow<T> for T` blanket impl.
@@ -97,8 +97,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
9797
} else {
9898
None
9999
})
100-
.filter(|tpred| tpred.def_id() == borrow_trait && &tpred.self_ty() == ty)
101-
.any(|tpred| &tpred.input_types().nth(1).expect("Borrow trait must have an parameter") != ty);
100+
.filter(|tpred| tpred.def_id() == borrow_trait && tpred.self_ty() == ty)
101+
.any(|tpred| tpred.input_types().nth(1).expect("Borrow trait must have an parameter") != ty);
102102

103103
if_let_chain! {[
104104
!is_self(arg),

clippy_lints/src/overflow_check_conditional.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OverflowCheckConditional {
3838
let Expr_::ExprPath(QPath::Resolved(_, ref path1)) = ident1.node,
3939
let Expr_::ExprPath(QPath::Resolved(_, ref path2)) = ident2.node,
4040
let Expr_::ExprPath(QPath::Resolved(_, ref path3)) = second.node,
41-
&path1.segments[0] == &path3.segments[0] || &path2.segments[0] == &path3.segments[0],
41+
path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0],
4242
cx.tables.expr_ty(ident1).is_integral(),
4343
cx.tables.expr_ty(ident2).is_integral()
4444
], {
@@ -62,7 +62,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OverflowCheckConditional {
6262
let Expr_::ExprPath(QPath::Resolved(_, ref path1)) = ident1.node,
6363
let Expr_::ExprPath(QPath::Resolved(_, ref path2)) = ident2.node,
6464
let Expr_::ExprPath(QPath::Resolved(_, ref path3)) = first.node,
65-
&path1.segments[0] == &path3.segments[0] || &path2.segments[0] == &path3.segments[0],
65+
path1.segments[0] == path3.segments[0] || path2.segments[0] == path3.segments[0],
6666
cx.tables.expr_ty(ident1).is_integral(),
6767
cx.tables.expr_ty(ident2).is_integral()
6868
], {

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub fn match_def_path(tcx: ty::TyCtxt, def_id: DefId, path: &[&str]) -> bool {
179179

180180
tcx.push_item_path(&mut apb, def_id);
181181

182-
apb.names.len() == path.len() && apb.names.iter().zip(path.iter()).all(|(a, &b)| &**a == b)
182+
apb.names.len() == path.len() && apb.names.into_iter().zip(path.iter()).all(|(a, &b)| *a == *b)
183183
}
184184

185185
/// Check if type is struct, enum or union type with given def path.

0 commit comments

Comments
 (0)