Skip to content

Commit 191fdda

Browse files
committed
rustc: minor cleanup
1 parent 2fc6b09 commit 191fdda

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/librustc/middle/trans/meth.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ pub fn trans_impl(ccx: @CrateContext, path: path, name: ast::ident,
7070
}
7171
}
7272

73-
trans_method(ccx, path, *method, param_substs_opt, self_ty, llfn,
73+
trans_method(ccx,
74+
path,
75+
*method,
76+
param_substs_opt,
77+
self_ty,
78+
llfn,
7479
ast_util::local_def(id));
7580
}
7681
}
@@ -106,11 +111,10 @@ pub fn trans_method(ccx: @CrateContext,
106111
_ => {
107112
// determine the (monomorphized) type that `self` maps to for
108113
// this method
109-
let self_ty;
110-
match base_self_ty {
111-
None => self_ty = ty::node_id_to_type(ccx.tcx, method.self_id),
112-
Some(provided_self_ty) => self_ty = provided_self_ty
113-
}
114+
let self_ty = match base_self_ty {
115+
None => ty::node_id_to_type(ccx.tcx, method.self_id),
116+
Some(provided_self_ty) => provided_self_ty,
117+
};
114118
let self_ty = match param_substs {
115119
None => self_ty,
116120
Some(@param_substs {tys: ref tys, _}) => {

src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ pub fn mark_for_expr(cx: Context, e: @expr) {
331331
node_type_needs(cx, use_tydesc, val.id);
332332
}
333333
expr_call(f, _, _) => {
334-
for vec::each(ty::ty_fn_args(ty::node_id_to_type(cx.ccx.tcx,
335-
f.id))) |a| {
334+
for ty::ty_fn_args(ty::node_id_to_type(cx.ccx.tcx, f.id))).each |a| {
336335
type_needs(cx, use_repr, a.ty);
337336
}
338337
}

0 commit comments

Comments
 (0)