syntax: Clean up the indentation for #[derive(Eq)]
This commit is contained in:
parent
01e56942a0
commit
ed437cd8fc
1 changed files with 14 additions and 12 deletions
|
@ -24,18 +24,20 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
|
|||
push: &mut FnMut(P<Item>))
|
||||
{
|
||||
fn cs_total_eq_assert(cx: &mut ExtCtxt, span: Span, substr: &Substructure) -> P<Expr> {
|
||||
cs_same_method(|cx, span, exprs| {
|
||||
// create `a.<method>(); b.<method>(); c.<method>(); ...`
|
||||
// (where method is `assert_receiver_is_total_eq`)
|
||||
let stmts = exprs.into_iter().map(|e| cx.stmt_expr(e)).collect();
|
||||
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)?") }),
|
||||
cx,
|
||||
span,
|
||||
substr)
|
||||
cs_same_method(
|
||||
|cx, span, exprs| {
|
||||
// create `a.<method>(); b.<method>(); c.<method>(); ...`
|
||||
// (where method is `assert_receiver_is_total_eq`)
|
||||
let stmts = exprs.into_iter().map(|e| cx.stmt_expr(e)).collect();
|
||||
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)?") }),
|
||||
cx,
|
||||
span,
|
||||
substr
|
||||
)
|
||||
}
|
||||
|
||||
let inline = cx.meta_word(span, InternedString::new("inline"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue