Skip to content

Commit 23e8b03

Browse files
committed
Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes
1 parent 37dfd97 commit 23e8b03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/iter_without_into_iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl {self_ty_without_ref} {{
225225
&& let ImplItemKind::Fn(sig, _) = item.kind
226226
&& let FnRetTy::Return(ret) = sig.decl.output
227227
&& is_nameable_in_impl_trait(ret)
228-
&& cx.tcx.generics_of(item_did).own_params.is_empty()
228+
&& cx.tcx.generics_of(item_did).is_own_empty()
229229
&& sig.decl.implicit_self == expected_implicit_self
230230
&& sig.decl.inputs.len() == 1
231231
&& let Some(imp) = get_parent_as_impl(cx.tcx, item.hir_id())

clippy_utils/src/ty/type_certainty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ fn qpath_certainty(cx: &LateContext<'_>, qpath: &QPath<'_>, resolves_to_type: bo
176176
.get(*lang_item)
177177
.map_or(Certainty::Uncertain, |def_id| {
178178
let generics = cx.tcx.generics_of(def_id);
179-
if generics.parent_count == 0 && generics.own_params.is_empty() {
179+
if generics.is_empty() {
180180
Certainty::Certain(if resolves_to_type { Some(def_id) } else { None })
181181
} else {
182182
Certainty::Uncertain

0 commit comments

Comments
 (0)