File tree 1 file changed +12
-14
lines changed
1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -3531,10 +3531,10 @@ impl<'hir> FnRetTy<'hir> {
3531
3531
}
3532
3532
3533
3533
pub fn is_suggestable_infer_ty ( & self ) -> Option < & ' hir Ty < ' hir > > {
3534
- if let Self :: Return ( ty) = self {
3535
- if ty. is_suggestable_infer_ty ( ) {
3536
- return Some ( * ty ) ;
3537
- }
3534
+ if let Self :: Return ( ty) = self
3535
+ && ty. is_suggestable_infer_ty ( )
3536
+ {
3537
+ return Some ( * ty ) ;
3538
3538
}
3539
3539
None
3540
3540
}
@@ -4409,16 +4409,14 @@ impl<'hir> Node<'hir> {
4409
4409
4410
4410
/// Get a `hir::Impl` if the node is an impl block for the given `trait_def_id`.
4411
4411
pub fn impl_block_of_trait ( self , trait_def_id : DefId ) -> Option < & ' hir Impl < ' hir > > {
4412
- match self {
4413
- Node :: Item ( Item { kind : ItemKind :: Impl ( impl_block) , .. } )
4414
- if impl_block
4415
- . of_trait
4416
- . and_then ( |trait_ref| trait_ref. trait_def_id ( ) )
4417
- . is_some_and ( |trait_id| trait_id == trait_def_id) =>
4418
- {
4419
- Some ( impl_block)
4420
- }
4421
- _ => None ,
4412
+ if let Node :: Item ( Item { kind : ItemKind :: Impl ( impl_block) , .. } ) = self
4413
+ && let Some ( trait_ref) = impl_block. of_trait
4414
+ && let Some ( trait_id) = trait_ref. trait_def_id ( )
4415
+ && trait_id == trait_def_id
4416
+ {
4417
+ Some ( impl_block)
4418
+ } else {
4419
+ None
4422
4420
}
4423
4421
}
4424
4422
You can’t perform that action at this time.
0 commit comments