Skip to content

Commit 71e7359

Browse files
committed
fixup warnings around the compiler
1 parent 2fc8d71 commit 71e7359

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clippy_lints/src/manual_non_exhaustive.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive {
9292
(matches!(v.data, VariantData::Unit(_, _)) && is_doc_hidden(cx.tcx.hir_attrs(v.hir_id)))
9393
.then_some((v.def_id, v.span))
9494
});
95-
if let Ok((id, span)) = iter.exactly_one()
95+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
96+
if let Ok((id, span)) = Itertools::exactly_one(iter)
9697
&& !find_attr!(cx.tcx.hir_attrs(item.hir_id()), AttributeKind::NonExhaustive(..))
9798
{
9899
self.potential_enums.push((item.owner_id.def_id, id, item.span, span));
@@ -104,7 +105,8 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive {
104105
.iter()
105106
.filter(|field| !cx.effective_visibilities.is_exported(field.def_id));
106107
if fields.len() > 1
107-
&& let Ok(field) = private_fields.exactly_one()
108+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
109+
&& let Ok(field) = Itertools::exactly_one(private_fields)
108110
&& let TyKind::Tup([]) = field.ty.kind
109111
{
110112
span_lint_and_then(

0 commit comments

Comments
 (0)