Skip to content

Commit 39aa9bf

Browse files
Remove needless indirection in bclose
1 parent 04b80a5 commit 39aa9bf

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/librustc/hir/print.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,6 @@ impl<'a> State<'a> {
169169
self.end(); // close the head-box
170170
}
171171

172-
pub fn bclose_(&mut self, span: syntax_pos::Span, indented: usize) {
173-
self.bclose_maybe_open(span, indented, true)
174-
}
175-
176172
pub fn bclose_maybe_open(&mut self,
177173
span: syntax_pos::Span,
178174
indented: usize,
@@ -187,7 +183,7 @@ impl<'a> State<'a> {
187183
}
188184

189185
pub fn bclose(&mut self, span: syntax_pos::Span) {
190-
self.bclose_(span, indent_unit)
186+
self.bclose_maybe_open(span, indent_unit, true)
191187
}
192188

193189
pub fn space_if_not_bol(&mut self) {
@@ -1276,7 +1272,7 @@ impl<'a> State<'a> {
12761272
for arm in arms {
12771273
self.print_arm(arm);
12781274
}
1279-
self.bclose_(expr.span, indent_unit);
1275+
self.bclose(expr.span);
12801276
}
12811277
hir::ExprKind::Closure(capture_clause, ref decl, body, _fn_decl_span, _gen) => {
12821278
self.print_capture_clause(capture_clause);

src/libsyntax/print/pprust.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,6 @@ impl<'a> State<'a> {
778778
self.end(); // close the head-box
779779
}
780780

781-
crate fn bclose_(&mut self, span: syntax_pos::Span,
782-
indented: usize) {
783-
self.bclose_maybe_open(span, indented, true)
784-
}
785781
crate fn bclose_maybe_open(&mut self, span: syntax_pos::Span,
786782
indented: usize, close_box: bool) {
787783
self.maybe_print_comment(span.hi());
@@ -792,7 +788,7 @@ impl<'a> State<'a> {
792788
}
793789
}
794790
crate fn bclose(&mut self, span: syntax_pos::Span) {
795-
self.bclose_(span, INDENT_UNIT)
791+
self.bclose_maybe_open(span, INDENT_UNIT, true)
796792
}
797793

798794
crate fn break_offset_if_not_bol(&mut self, n: usize,
@@ -2027,7 +2023,7 @@ impl<'a> State<'a> {
20272023
for arm in arms {
20282024
self.print_arm(arm);
20292025
}
2030-
self.bclose_(expr.span, INDENT_UNIT);
2026+
self.bclose(expr.span);
20312027
}
20322028
ast::ExprKind::Closure(
20332029
capture_clause, asyncness, movability, ref decl, ref body, _) => {

0 commit comments

Comments
 (0)