]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/map_unit_fn.rs
Auto merge of #5387 - jpospychala:useless_self_fp, r=yaahc
[rust.git] / clippy_lints / src / map_unit_fn.rs
index a4e1b2c0d3326a1f4058132ecb86af2862281fec..c5bb559e18ea5d2f50042078645a97464cf0071c 100644 (file)
@@ -1,10 +1,10 @@
 use crate::utils::paths;
 use crate::utils::{iter_input_pats, match_type, method_chain_args, snippet, span_lint_and_then};
 use if_chain::if_chain;
-use rustc::ty::{self, Ty};
 use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_lint::{LateContext, LateLintPass};
+use rustc_middle::ty::{self, Ty};
 use rustc_session::{declare_lint_pass, declare_tool_lint};
 use rustc_span::source_map::Span;
 
@@ -186,12 +186,12 @@ fn unit_closure<'a, 'tcx>(
 /// `x.field` => `x_field`
 /// `y` => `_y`
 ///
-/// Anything else will return `_`.
+/// Anything else will return `a`.
 fn let_binding_name(cx: &LateContext<'_, '_>, var_arg: &hir::Expr<'_>) -> String {
     match &var_arg.kind {
         hir::ExprKind::Field(_, _) => snippet(cx, var_arg.span, "_").replace(".", "_"),
         hir::ExprKind::Path(_) => format!("_{}", snippet(cx, var_arg.span, "")),
-        _ => "_".to_string(),
+        _ => "a".to_string(),
     }
 }