chore: fmt and cleanup

This commit is contained in:
Caleb Cartwright 2021-03-28 17:30:53 -05:00 committed by Caleb Cartwright
parent 4948911608
commit c32f2ec015
3 changed files with 4 additions and 12 deletions

View File

@ -107,16 +107,8 @@ pub(crate) fn format_expr(
}
ast::ExprKind::Unary(op, ref subexpr) => rewrite_unary_op(context, op, subexpr, shape),
ast::ExprKind::Struct(ref struct_expr) => {
let ast::StructExpr { ref fields, ref path, ref rest } = **struct_expr;
rewrite_struct_lit(
context,
path,
fields,
rest,
&expr.attrs,
expr.span,
shape,
)
let ast::StructExpr { fields, path, rest } = &**struct_expr;
rewrite_struct_lit(context, path, fields, rest, &expr.attrs, expr.span, shape)
}
ast::ExprKind::Tup(ref items) => {
rewrite_tuple(context, items.iter(), expr.span, shape, items.len() == 1)

View File

@ -4,7 +4,7 @@ use std::collections::HashMap;
use std::io::{self, Write};
use std::time::{Duration, Instant};
use rustc_ast::{ast, AstLike};
use rustc_ast::ast;
use rustc_span::Span;
use self::newline_style::apply_newline_style;

View File

@ -1,4 +1,4 @@
use rustc_ast::ast::{self, BindingMode, PatField, Pat, PatKind, RangeEnd, RangeSyntax};
use rustc_ast::ast::{self, BindingMode, Pat, PatField, PatKind, RangeEnd, RangeSyntax};
use rustc_ast::ptr;
use rustc_span::{BytePos, Span};