Skip to content

Commit 5ea9977

Browse files
committed
Auto merge of rust-lang#101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkov
Simplify `hir::PathSegment` r? `@petrochenkov`
2 parents 9ae3292 + 25f6f18 commit 5ea9977

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

clippy_lints/src/operators/op_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn in_impl<'tcx>(
185185
if let ItemKind::Impl(item) = &item.kind;
186186
if let Some(of_trait) = &item.of_trait;
187187
if let Some(seg) = of_trait.path.segments.last();
188-
if let Some(Res::Def(_, trait_id)) = seg.res;
188+
if let Res::Def(_, trait_id) = seg.res;
189189
if trait_id == bin_op;
190190
if let Some(generic_args) = seg.args;
191191
if let Some(GenericArg::Type(other_ty)) = generic_args.args.last();

clippy_lints/src/ref_option_ref.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ impl<'tcx> LateLintPass<'tcx> for RefOptionRef {
4343
if mut_ty.mutbl == Mutability::Not;
4444
if let TyKind::Path(ref qpath) = &mut_ty.ty.kind;
4545
let last = last_path_segment(qpath);
46-
if let Some(res) = last.res;
47-
if let Some(def_id) = res.opt_def_id();
46+
if let Some(def_id) = last.res.opt_def_id();
4847

4948
if cx.tcx.is_diagnostic_item(sym::Option, def_id);
5049
if let Some(params) = last_path_segment(qpath).args ;

clippy_lints/src/trait_bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
128128
if !bound_predicate.span.from_expansion();
129129
if let TyKind::Path(QPath::Resolved(_, Path { segments, .. })) = bound_predicate.bounded_ty.kind;
130130
if let Some(PathSegment {
131-
res: Some(Res::SelfTy{ trait_: Some(def_id), alias_to: _ }), ..
131+
res: Res::SelfTy{ trait_: Some(def_id), alias_to: _ }, ..
132132
}) = segments.first();
133133
if let Some(
134134
Node::Item(

0 commit comments

Comments
 (0)