From 13785c4c2ecf26e859c38b5656f611ae2a84fdba Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Mon, 13 Jan 2020 16:54:58 +0900 Subject: [PATCH] Remove unneeded scope --- src/librustdoc/clean/auto_trait.rs | 58 ++++++++++++++---------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index c8b63ed5c8096..56013ee3a816f 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -560,8 +560,8 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { lifetime_to_bounds.entry(lifetime).or_default().extend(bounds); } WherePredicate::EqPredicate { lhs, rhs } => { - match &lhs { - &Type::QPath { name: ref left_name, ref self_type, ref trait_ } => { + match lhs { + Type::QPath { name: ref left_name, ref self_type, ref trait_ } => { let ty = &*self_type; match **trait_ { Type::ResolvedPath { @@ -580,36 +580,30 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> { continue; } - // FIXME: Remove this scope when NLL lands - { - let args = &mut new_trait_path - .segments - .last_mut() - .expect("segments were empty") - .args; - - match args { - // Convert somethiung like ' = u8' - // to 'T: Iterator' - &mut GenericArgs::AngleBracketed { - ref mut bindings, - .. - } => { - bindings.push(TypeBinding { - name: left_name.clone(), - kind: TypeBindingKind::Equality { ty: rhs }, - }); - } - &mut GenericArgs::Parenthesized { .. } => { - existing_predicates.push( - WherePredicate::EqPredicate { - lhs: lhs.clone(), - rhs, - }, - ); - continue; // If something other than a Fn ends up - // with parenthesis, leave it alone - } + let args = &mut new_trait_path + .segments + .last_mut() + .expect("segments were empty") + .args; + + match args { + // Convert somethiung like ' = u8' + // to 'T: Iterator' + GenericArgs::AngleBracketed { + ref mut bindings, .. + } => { + bindings.push(TypeBinding { + name: left_name.clone(), + kind: TypeBindingKind::Equality { ty: rhs }, + }); + } + GenericArgs::Parenthesized { .. } => { + existing_predicates.push(WherePredicate::EqPredicate { + lhs: lhs.clone(), + rhs, + }); + continue; // If something other than a Fn ends up + // with parenthesis, leave it alone } }