1
Fork 0

syntax: Clean up the indentation for #[derive(Eq)]

This commit is contained in:
Erick Tryzelaar 2015-04-01 10:51:24 -07:00
parent 01e56942a0
commit ed437cd8fc

View file

@ -24,18 +24,20 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
push: &mut FnMut(P<Item>)) push: &mut FnMut(P<Item>))
{ {
fn cs_total_eq_assert(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> { fn cs_total_eq_assert(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
cs_same_method(|cx, span, exprs| { cs_same_method(
// create `a.<method>(); b.<method>(); c.<method>(); ...` |cx, span, exprs| {
// (where method is `assert_receiver_is_total_eq`) // create `a.<method>(); b.<method>(); c.<method>(); ...`
let stmts = exprs.into_iter().map(|e| cx.stmt_expr(e)).collect(); // (where method is `assert_receiver_is_total_eq`)
let block = cx.block(span, stmts, None); let stmts = exprs.into_iter().map(|e| cx.stmt_expr(e)).collect();
cx.expr_block(block) let block = cx.block(span, stmts, None);
}, cx.expr_block(block)
Box::new(|cx, sp, _, _| { },
cx.span_bug(sp, "non matching enums in derive(Eq)?") }), Box::new(|cx, sp, _, _| {
cx, cx.span_bug(sp, "non matching enums in derive(Eq)?") }),
span, cx,
substr) span,
substr
)
} }
let inline = cx.meta_word(span, InternedString::new("inline")); let inline = cx.meta_word(span, InternedString::new("inline"));