Skip to content

Commit 328b4fa

Browse files
committed
Rename some name variables as ident.
It bugs me when variables of type `Ident` are called `name`. It leads to silly things like `name.name`. `Ident` variables should be called `ident`, and `name` should be used for variables of type `Symbol`. This commit improves things by by doing `s/name/ident/` on a bunch of `Ident` variables. Not all of them, but a decent chunk.
1 parent 76d5a26 commit 328b4fa

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clippy_lints/src/bool_assert_comparison.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn is_impl_not_trait_with_bool_out<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -
5353
.not_trait()
5454
.filter(|trait_id| implements_trait(cx, ty, *trait_id, &[]))
5555
.and_then(|trait_id| {
56-
cx.tcx.associated_items(trait_id).find_by_name_and_kind(
56+
cx.tcx.associated_items(trait_id).find_by_ident_and_kind(
5757
cx.tcx,
5858
Ident::from_str("Output"),
5959
ty::AssocKind::Type,

clippy_lints/src/functions/renamed_function_params.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pub(super) fn check_impl_item(cx: &LateContext<'_>, item: &ImplItem<'_>, ignored
2222
&& let Some(did) = trait_item_def_id_of_impl(items, item.owner_id)
2323
&& !is_from_ignored_trait(trait_ref, ignored_traits)
2424
{
25-
let mut param_idents_iter = cx.tcx.hir_body_param_names(body_id);
26-
let mut default_param_idents_iter = cx.tcx.fn_arg_names(did).iter().copied();
25+
let mut param_idents_iter = cx.tcx.hir_body_param_idents(body_id);
26+
let mut default_param_idents_iter = cx.tcx.fn_arg_idents(did).iter().copied();
2727

2828
let renames = RenamedFnArgs::new(&mut default_param_idents_iter, &mut param_idents_iter);
2929
if !renames.0.is_empty() {

clippy_lints/src/methods/needless_collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn is_contains_sig(cx: &LateContext<'_>, call_id: HirId, iter_expr: &Expr<'_>) -
238238
.instantiate_bound_regions_with_erased(sig.rebind(search_ty))
239239
.kind()
240240
&& let Some(iter_trait) = cx.tcx.get_diagnostic_item(sym::Iterator)
241-
&& let Some(iter_item) = cx.tcx.associated_items(iter_trait).find_by_name_and_kind(
241+
&& let Some(iter_item) = cx.tcx.associated_items(iter_trait).find_by_ident_and_kind(
242242
cx.tcx,
243243
Ident::with_dummy_span(sym::Item),
244244
AssocKind::Type,

clippy_utils/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ pub fn make_projection<'tcx>(
11091109
assoc_ty: Symbol,
11101110
args: GenericArgsRef<'tcx>,
11111111
) -> Option<AliasTy<'tcx>> {
1112-
let Some(assoc_item) = tcx.associated_items(container_id).find_by_name_and_kind(
1112+
let Some(assoc_item) = tcx.associated_items(container_id).find_by_ident_and_kind(
11131113
tcx,
11141114
Ident::with_dummy_span(assoc_ty),
11151115
AssocKind::Type,

0 commit comments

Comments
 (0)