]> git.lizzy.rs Git - rust.git/commitdiff
rustc: minor cleanup
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Sat, 27 Apr 2013 02:10:28 +0000 (19:10 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Wed, 15 May 2013 03:10:45 +0000 (20:10 -0700)
src/librustc/middle/trans/meth.rs
src/librustc/middle/trans/type_use.rs

index d4856de21849d3094e51832e970cd8970d0f5a8e..bac7218f16ad6a4e65b6d733f318350e09efebcc 100644 (file)
@@ -70,7 +70,12 @@ pub fn trans_impl(ccx: @CrateContext, path: path, name: ast::ident,
                 }
             }
 
-            trans_method(ccx, path, *method, param_substs_opt, self_ty, llfn,
+            trans_method(ccx,
+                         path,
+                         *method,
+                         param_substs_opt,
+                         self_ty,
+                         llfn,
                          ast_util::local_def(id));
         }
     }
@@ -106,11 +111,10 @@ pub fn trans_method(ccx: @CrateContext,
       _ => {
         // determine the (monomorphized) type that `self` maps to for
         // this method
-        let self_ty;
-        match base_self_ty {
-            None => self_ty = ty::node_id_to_type(ccx.tcx, method.self_id),
-            Some(provided_self_ty) => self_ty = provided_self_ty
-        }
+        let self_ty = match base_self_ty {
+            None => ty::node_id_to_type(ccx.tcx, method.self_id),
+            Some(provided_self_ty) => provided_self_ty,
+        };
         let self_ty = match param_substs {
             None => self_ty,
             Some(@param_substs {tys: ref tys, _}) => {
index c15c31055c36394ef2233b4cc245cfd9c85bbf40..ff375b21363530a17adc0cfa61d2f93435d7ad38 100644 (file)
@@ -331,8 +331,7 @@ pub fn mark_for_expr(cx: Context, e: @expr) {
         node_type_needs(cx, use_tydesc, val.id);
       }
       expr_call(f, _, _) => {
-          for vec::each(ty::ty_fn_args(ty::node_id_to_type(cx.ccx.tcx,
-                                                           f.id))) |a| {
+          for ty::ty_fn_args(ty::node_id_to_type(cx.ccx.tcx, f.id))).each |a| {
               type_needs(cx, use_repr, a.ty);
           }
       }