Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 20781f1

Browse files
committed
Rename qpath_generic_tys
1 parent bea09a2 commit 20781f1

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clippy_lints/src/types/rc_buffer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_sugg;
22
use clippy_utils::source::snippet_with_applicability;
3-
use clippy_utils::{get_qpath_generic_tys, is_ty_param_diagnostic_item};
3+
use clippy_utils::{is_ty_param_diagnostic_item, qpath_generic_tys};
44
use rustc_errors::Applicability;
55
use rustc_hir::{self as hir, def_id::DefId, QPath, TyKind};
66
use rustc_lint::LateContext;
@@ -25,7 +25,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
2525
TyKind::Path(qpath) => qpath,
2626
_ => return false,
2727
};
28-
let inner_span = match get_qpath_generic_tys(qpath).next() {
28+
let inner_span = match qpath_generic_tys(qpath).next() {
2929
Some(ty) => ty.span,
3030
None => return false,
3131
};
@@ -60,7 +60,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
6060
TyKind::Path(qpath) => qpath,
6161
_ => return false,
6262
};
63-
let inner_span = match get_qpath_generic_tys(qpath).next() {
63+
let inner_span = match qpath_generic_tys(qpath).next() {
6464
Some(ty) => ty.span,
6565
None => return false,
6666
};

clippy_lints/src/types/redundant_allocation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
22
use clippy_utils::source::{snippet, snippet_with_applicability};
3-
use clippy_utils::{get_qpath_generic_tys, is_ty_param_diagnostic_item, is_ty_param_lang_item};
3+
use clippy_utils::{is_ty_param_diagnostic_item, is_ty_param_lang_item, qpath_generic_tys};
44
use rustc_errors::Applicability;
55
use rustc_hir::{self as hir, def_id::DefId, LangItem, QPath, TyKind};
66
use rustc_lint::LateContext;
@@ -53,7 +53,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
5353
TyKind::Path(inner_qpath) => inner_qpath,
5454
_ => return false,
5555
};
56-
let inner_span = match get_qpath_generic_tys(inner_qpath).next() {
56+
let inner_span = match qpath_generic_tys(inner_qpath).next() {
5757
Some(ty) => {
5858
// Box<Box<dyn T>> is smaller than Box<dyn T> because of wide pointers
5959
if matches!(ty.kind, TyKind::TraitObject(..)) {

clippy_utils/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub fn is_ty_param_lang_item<'tcx>(
268268
qpath: &QPath<'tcx>,
269269
item: LangItem,
270270
) -> Option<&'tcx hir::Ty<'tcx>> {
271-
let ty = get_qpath_generic_tys(qpath).next()?;
271+
let ty = qpath_generic_tys(qpath).next()?;
272272

273273
if let TyKind::Path(qpath) = &ty.kind {
274274
cx.qpath_res(qpath, ty.hir_id)
@@ -288,7 +288,7 @@ pub fn is_ty_param_diagnostic_item<'tcx>(
288288
qpath: &QPath<'tcx>,
289289
item: Symbol,
290290
) -> Option<&'tcx hir::Ty<'tcx>> {
291-
let ty = get_qpath_generic_tys(qpath).next()?;
291+
let ty = qpath_generic_tys(qpath).next()?;
292292

293293
if let TyKind::Path(qpath) = &ty.kind {
294294
cx.qpath_res(qpath, ty.hir_id)
@@ -368,7 +368,7 @@ pub fn get_qpath_generics<'tcx>(path: &QPath<'tcx>) -> Option<&'tcx GenericArgs<
368368
}
369369
}
370370

371-
pub fn get_qpath_generic_tys<'tcx>(path: &QPath<'tcx>) -> impl Iterator<Item = &'tcx hir::Ty<'tcx>> {
371+
pub fn qpath_generic_tys<'tcx>(path: &QPath<'tcx>) -> impl Iterator<Item = &'tcx hir::Ty<'tcx>> {
372372
get_qpath_generics(path)
373373
.map_or([].as_ref(), |a| a.args)
374374
.iter()

0 commit comments

Comments
 (0)