Remove needless indirection in bclose

This commit is contained in:
Mark Rousskov 2019-07-09 07:38:31 -04:00
parent 04b80a5f5d
commit 39aa9bf730
2 changed files with 4 additions and 12 deletions

View file

@ -169,10 +169,6 @@ impl<'a> State<'a> {
self.end(); // close the head-box
}
pub fn bclose_(&mut self, span: syntax_pos::Span, indented: usize) {
self.bclose_maybe_open(span, indented, true)
}
pub fn bclose_maybe_open(&mut self,
span: syntax_pos::Span,
indented: usize,
@ -187,7 +183,7 @@ impl<'a> State<'a> {
}
pub fn bclose(&mut self, span: syntax_pos::Span) {
self.bclose_(span, indent_unit)
self.bclose_maybe_open(span, indent_unit, true)
}
pub fn space_if_not_bol(&mut self) {
@ -1276,7 +1272,7 @@ impl<'a> State<'a> {
for arm in arms {
self.print_arm(arm);
}
self.bclose_(expr.span, indent_unit);
self.bclose(expr.span);
}
hir::ExprKind::Closure(capture_clause, ref decl, body, _fn_decl_span, _gen) => {
self.print_capture_clause(capture_clause);

View file

@ -778,10 +778,6 @@ impl<'a> State<'a> {
self.end(); // close the head-box
}
crate fn bclose_(&mut self, span: syntax_pos::Span,
indented: usize) {
self.bclose_maybe_open(span, indented, true)
}
crate fn bclose_maybe_open(&mut self, span: syntax_pos::Span,
indented: usize, close_box: bool) {
self.maybe_print_comment(span.hi());
@ -792,7 +788,7 @@ impl<'a> State<'a> {
}
}
crate fn bclose(&mut self, span: syntax_pos::Span) {
self.bclose_(span, INDENT_UNIT)
self.bclose_maybe_open(span, INDENT_UNIT, true)
}
crate fn break_offset_if_not_bol(&mut self, n: usize,
@ -2027,7 +2023,7 @@ impl<'a> State<'a> {
for arm in arms {
self.print_arm(arm);
}
self.bclose_(expr.span, INDENT_UNIT);
self.bclose(expr.span);
}
ast::ExprKind::Closure(
capture_clause, asyncness, movability, ref decl, ref body, _) => {