Skip to content

Commit e26d5eb

Browse files
committed
---
yaml --- r: 145266 b: refs/heads/try2 c: 1a90f24 h: refs/heads/master v: v3
1 parent 9b18032 commit e26d5eb

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 5ab843fbc3924fc7706f8adf281da7aff3dced31
8+
refs/heads/try2: 1a90f24bbdd4decec3df35d628fdb8825675190a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libsyntax/ext/deriving/default.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ fn default_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Exp
4747
cx.ident_of("Default"),
4848
cx.ident_of("default")
4949
];
50-
let default_call = || {
51-
cx.expr_call_global(span, default_ident.clone(), ~[])
52-
};
50+
let default_call = cx.expr_call_global(span, default_ident.clone(), ~[]);
5351

5452
return match *substr.fields {
5553
StaticStruct(_, ref summary) => {
@@ -58,13 +56,13 @@ fn default_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Exp
5856
if count == 0 {
5957
cx.expr_ident(span, substr.type_ident)
6058
} else {
61-
let exprs = vec::from_fn(count, |_| default_call());
59+
let exprs = vec::from_elem(count, default_call);
6260
cx.expr_call_ident(span, substr.type_ident, exprs)
6361
}
6462
}
6563
Right(ref fields) => {
6664
let default_fields = do fields.map |ident| {
67-
cx.field_imm(span, *ident, default_call())
65+
cx.field_imm(span, *ident, default_call)
6866
};
6967
cx.expr_struct_ident(span, substr.type_ident, default_fields)
7068
}

branches/try2/src/libsyntax/ext/deriving/zero.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ fn zero_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
6262
cx.ident_of("Zero"),
6363
cx.ident_of("zero")
6464
];
65-
let zero_call = || {
66-
cx.expr_call_global(span, zero_ident.clone(), ~[])
67-
};
65+
let zero_call = cx.expr_call_global(span, zero_ident.clone(), ~[]);
6866

6967
return match *substr.fields {
7068
StaticStruct(_, ref summary) => {
@@ -73,13 +71,13 @@ fn zero_substructure(cx: @ExtCtxt, span: Span, substr: &Substructure) -> @Expr {
7371
if count == 0 {
7472
cx.expr_ident(span, substr.type_ident)
7573
} else {
76-
let exprs = vec::from_fn(count, |_| zero_call());
74+
let exprs = vec::from_elem(count, zero_call);
7775
cx.expr_call_ident(span, substr.type_ident, exprs)
7876
}
7977
}
8078
Right(ref fields) => {
8179
let zero_fields = do fields.map |ident| {
82-
cx.field_imm(span, *ident, zero_call())
80+
cx.field_imm(span, *ident, zero_call)
8381
};
8482
cx.expr_struct_ident(span, substr.type_ident, zero_fields)
8583
}

0 commit comments

Comments
 (0)